diff options
Diffstat (limited to 'chromium/components/language/language_code_locator.h')
-rw-r--r-- | chromium/components/language/language_code_locator.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/chromium/components/language/language_code_locator.h b/chromium/components/language/language_code_locator.h new file mode 100644 index 00000000000..3cc9ac66867 --- /dev/null +++ b/chromium/components/language/language_code_locator.h @@ -0,0 +1,35 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_LANGUAGE_LANGUAGE_CODE_LOCATOR_H_ +#define COMPONENTS_LANGUAGE_LANGUAGE_CODE_LOCATOR_H_ + +#include <string> +#include <vector> + +#include "base/containers/flat_map.h" +#include "base/macros.h" + +namespace language { + +class LanguageCodeLocator { + public: + LanguageCodeLocator(); + ~LanguageCodeLocator(); + + // Find the language code given a coordinate. + // If the latitude, longitude pair is not found, will return an empty vector. + std::vector<std::string> GetLanguageCode(double latitude, + double longitude) const; + + private: + // Map from s2 cellid to ';' delimited list of language codes. + const base::flat_map<uint64_t, std::string> district_languages_; + + DISALLOW_COPY_AND_ASSIGN(LanguageCodeLocator); +}; + +} // namespace language + +#endif // COMPONENTS_LANGUAGE_LANGUAGE_CODE_LOCATOR_H_ |