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