Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(588)

Unified Diff: third_party/libaddressinput/chromium/cpp/src/fallback_data_store.h

Issue 137563004: libaddressinput: Add fallback data for US address validation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git cl try Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/libaddressinput/chromium/cpp/src/fallback_data_store.h
diff --git a/third_party/libaddressinput/chromium/cpp/src/region_data_constants.h b/third_party/libaddressinput/chromium/cpp/src/fallback_data_store.h
similarity index 61%
copy from third_party/libaddressinput/chromium/cpp/src/region_data_constants.h
copy to third_party/libaddressinput/chromium/cpp/src/fallback_data_store.h
index 3897174b01cba0ffd1f297256e1dd8452b9301b3..c5f9e364f09c4ad7aa3f17281a2e0fa4546554ac 100644
--- a/third_party/libaddressinput/chromium/cpp/src/region_data_constants.h
+++ b/third_party/libaddressinput/chromium/cpp/src/fallback_data_store.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2013 Google Inc.
+// Copyright (C) 2014 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,23 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef I18N_ADDRESSINPUT_REGION_DATA_CONSTANTS_H_
please use gerrit instead 2014/01/16 01:25:46 Don't we need a header guard?
Evan Stade 2014/01/16 01:53:55 yes we do, i simply forgot it.
-#define I18N_ADDRESSINPUT_REGION_DATA_CONSTANTS_H_
-
#include <string>
-#include <vector>
namespace i18n {
namespace addressinput {
-class RegionDataConstants {
+class FallbackDataStore {
public:
- static const std::vector<std::string>& GetRegionCodes();
- static const std::string& GetRegionData(const std::string& region_code);
- static const std::string& GetDefaultRegionData();
+ // Gets default data for |key|. Should only be used as a last resort after
+ // attempts to check the local cache or the webserver have failed.
+ static bool Get(const std::string& key, std::string* data);
};
} // namespace addressinput
} // namespace i18n
-
-#endif // I18N_ADDRESSINPUT_REGION_DATA_CONSTANTS_H_

Powered by Google App Engine
This is Rietveld 408576698