| OLD | NEW |
| 1 // Copyright (C) 2013 Google Inc. | 1 // Copyright (C) 2013 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, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 namespace i18n { | 35 namespace i18n { |
| 36 namespace addressinput { | 36 namespace addressinput { |
| 37 | 37 |
| 38 namespace { | 38 namespace { |
| 39 | 39 |
| 40 // Validates AddressData structure. | 40 // Validates AddressData structure. |
| 41 class AddressValidatorImpl : public AddressValidator { | 41 class AddressValidatorImpl : public AddressValidator { |
| 42 public: | 42 public: |
| 43 // Takes ownership of |downloader| and |storage|. Does not take ownership of | 43 // Takes ownership of |downloader| and |storage|. Does not take ownership of |
| 44 // |load_rules_delegate|. | 44 // |load_rules_delegate|. |
| 45 AddressValidatorImpl(scoped_ptr<const Downloader> downloader, | 45 AddressValidatorImpl(scoped_ptr<Downloader> downloader, |
| 46 scoped_ptr<Storage> storage, | 46 scoped_ptr<Storage> storage, |
| 47 LoadRulesDelegate* load_rules_delegate) | 47 LoadRulesDelegate* load_rules_delegate) |
| 48 : aggregator_(scoped_ptr<Retriever>(new Retriever( | 48 : aggregator_(scoped_ptr<Retriever>(new Retriever( |
| 49 VALIDATION_DATA_URL, | 49 VALIDATION_DATA_URL, |
| 50 downloader.Pass(), | 50 downloader.Pass(), |
| 51 storage.Pass()))), | 51 storage.Pass()))), |
| 52 load_rules_delegate_(load_rules_delegate), | 52 load_rules_delegate_(load_rules_delegate), |
| 53 loading_rules_(), | 53 loading_rules_(), |
| 54 rules_() {} | 54 rules_() {} |
| 55 | 55 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 DISALLOW_COPY_AND_ASSIGN(AddressValidatorImpl); | 110 DISALLOW_COPY_AND_ASSIGN(AddressValidatorImpl); |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 } // namespace | 113 } // namespace |
| 114 | 114 |
| 115 AddressValidator::~AddressValidator() {} | 115 AddressValidator::~AddressValidator() {} |
| 116 | 116 |
| 117 // static | 117 // static |
| 118 scoped_ptr<AddressValidator> AddressValidator::Build( | 118 scoped_ptr<AddressValidator> AddressValidator::Build( |
| 119 scoped_ptr<const Downloader> downloader, | 119 scoped_ptr<Downloader> downloader, |
| 120 scoped_ptr<Storage> storage, | 120 scoped_ptr<Storage> storage, |
| 121 LoadRulesDelegate* load_rules_delegate) { | 121 LoadRulesDelegate* load_rules_delegate) { |
| 122 return scoped_ptr<AddressValidator>(new AddressValidatorImpl( | 122 return scoped_ptr<AddressValidator>(new AddressValidatorImpl( |
| 123 downloader.Pass(), storage.Pass(), load_rules_delegate)); | 123 downloader.Pass(), storage.Pass(), load_rules_delegate)); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace addressinput | 126 } // namespace addressinput |
| 127 } // namespace i18n | 127 } // namespace i18n |
| OLD | NEW |