OLD | NEW |
1 // Copyright (C) 2014 Google Inc. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // found in the LICENSE file. |
4 // you may not use this file except in compliance with the License. | |
5 // You may obtain a copy of the License at | |
6 // | |
7 // http://www.apache.org/licenses/LICENSE-2.0 | |
8 // | |
9 // Unless required by applicable law or agreed to in writing, software | |
10 // distributed under the License is distributed on an "AS IS" BASIS, | |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 // See the License for the specific language governing permissions and | |
13 // limitations under the License. | |
14 | 4 |
15 #include "fallback_data_store.h" | 5 #include "fallback_data_store.h" |
16 | 6 |
17 #include <string> | 7 #include <string> |
18 | 8 |
19 namespace i18n { | 9 namespace autofill { |
20 namespace addressinput { | |
21 | 10 |
22 bool FallbackDataStore::Get(const std::string& key, std::string* data) { | 11 bool FallbackDataStore::Get(const std::string& key, std::string* data) { |
23 if (key != "data/US") | 12 if (key != "data/US") |
24 return false; | 13 return false; |
25 | 14 |
26 // Available at https://i18napis.appspot.com/ssl-aggregate-address/data/US | 15 // Available at https://i18napis.appspot.com/ssl-aggregate-address/data/US. |
| 16 // The appended checksum is valid, but the timestamp is old. |
27 data->assign( | 17 data->assign( |
| 18 "timestamp=0\n" |
| 19 "checksum=38d4bcdadfe494ffe062a7ad668d66d6\n" |
28 "{\"data/US/LA\": {\"lang\": \"en\", \"zipex\": \"70000,71599\", \"nam" | 20 "{\"data/US/LA\": {\"lang\": \"en\", \"zipex\": \"70000,71599\", \"nam" |
29 "e\": \"Louisiana\", \"zip\": \"70|71[0-5]\", \"key\": \"LA\", \"id\":" | 21 "e\": \"Louisiana\", \"zip\": \"70|71[0-5]\", \"key\": \"LA\", \"id\":" |
30 " \"data/US/LA\"}, \"data/US/VT\": {\"lang\": \"en\", \"zipex\": \"0500" | 22 " \"data/US/LA\"}, \"data/US/VT\": {\"lang\": \"en\", \"zipex\": \"0500" |
31 "0,05999\", \"name\": \"Vermont\", \"zip\": \"05\", \"key\": \"VT\", \"" | 23 "0,05999\", \"name\": \"Vermont\", \"zip\": \"05\", \"key\": \"VT\", \"" |
32 "id\": \"data/US/VT\"}, \"data/US/NM\": {\"lang\": \"en\", \"zipex\": \"" | 24 "id\": \"data/US/VT\"}, \"data/US/NM\": {\"lang\": \"en\", \"zipex\": \"" |
33 "87000,88499\", \"name\": \"New Mexico\", \"zip\": \"87|88[0-4]\", \"k" | 25 "87000,88499\", \"name\": \"New Mexico\", \"zip\": \"87|88[0-4]\", \"k" |
34 "ey\": \"NM\", \"id\": \"data/US/NM\"}, \"data/US/NJ\": {\"lang\": \"e" | 26 "ey\": \"NM\", \"id\": \"data/US/NM\"}, \"data/US/NJ\": {\"lang\": \"e" |
35 "n\", \"zipex\": \"07000,08999\", \"name\": \"New Jersey\", \"zip\": \"" | 27 "n\", \"zipex\": \"07000,08999\", \"name\": \"New Jersey\", \"zip\": \"" |
36 "0[78]\", \"key\": \"NJ\", \"id\": \"data/US/NJ\"}, \"data/US/NH\": {\"" | 28 "0[78]\", \"key\": \"NJ\", \"id\": \"data/US/NJ\"}, \"data/US/NH\": {\"" |
37 "lang\": \"en\", \"zipex\": \"03000,03899\", \"name\": \"New Hampshire\"" | 29 "lang\": \"en\", \"zipex\": \"03000,03899\", \"name\": \"New Hampshire\"" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 "e\": \"Washington\", \"zip\": \"98|99[0-4]\", \"key\": \"WA\", \"id\":" | 193 "e\": \"Washington\", \"zip\": \"98|99[0-4]\", \"key\": \"WA\", \"id\":" |
202 " \"data/US/WA\"}, \"data/US/DC\": {\"lang\": \"en\", \"zipex\": \"2000" | 194 " \"data/US/WA\"}, \"data/US/DC\": {\"lang\": \"en\", \"zipex\": \"2000" |
203 "0,20099:20200,20599:56900,56999\", \"name\": \"District of Columbia\"," | 195 "0,20099:20200,20599:56900,56999\", \"name\": \"District of Columbia\"," |
204 " \"zip\": \"20[02-5]|569\", \"key\": \"DC\", \"id\": \"data/US/DC\"}," | 196 " \"zip\": \"20[02-5]|569\", \"key\": \"DC\", \"id\": \"data/US/DC\"}," |
205 " \"data/US/HI\": {\"lang\": \"en\", \"zipex\": \"96700,96798:96800,968" | 197 " \"data/US/HI\": {\"lang\": \"en\", \"zipex\": \"96700,96798:96800,968" |
206 "99\", \"name\": \"Hawaii\", \"zip\": \"967[0-8]|9679[0-8]|968\", \"key" | 198 "99\", \"name\": \"Hawaii\", \"zip\": \"967[0-8]|9679[0-8]|968\", \"key" |
207 "\": \"HI\", \"id\": \"data/US/HI\"}}"); | 199 "\": \"HI\", \"id\": \"data/US/HI\"}}"); |
208 return true; | 200 return true; |
209 } | 201 } |
210 | 202 |
211 } // namespace addressinput | 203 } // namespace autofill |
212 } // namespace i18n | |
OLD | NEW |