OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_CHROME_STORAGE_IMPL_H_ | 5 #ifndef THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_CHROME_STORAGE_IMPL_H_ |
6 #define THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_CHROME_STORAGE_IMPL_H_ | 6 #define THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_CHROME_STORAGE_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 // An implementation of the Storage interface which passes through to an | 21 // An implementation of the Storage interface which passes through to an |
22 // underlying WriteablePrefStore. | 22 // underlying WriteablePrefStore. |
23 class ChromeStorageImpl : public ::i18n::addressinput::Storage, | 23 class ChromeStorageImpl : public ::i18n::addressinput::Storage, |
24 public PrefStore::Observer { | 24 public PrefStore::Observer { |
25 public: | 25 public: |
26 // |store| must outlive |this|. | 26 // |store| must outlive |this|. |
27 explicit ChromeStorageImpl(WriteablePrefStore* store); | 27 explicit ChromeStorageImpl(WriteablePrefStore* store); |
28 virtual ~ChromeStorageImpl(); | 28 virtual ~ChromeStorageImpl(); |
29 | 29 |
30 // ::i18n::addressinput::Storage implementation. | 30 // ::i18n::addressinput::Storage implementation. |
31 virtual void Put(const std::string& key, const std::string& data) OVERRIDE; | 31 virtual void Put(const std::string& key, scoped_ptr<std::string> data) |
| 32 OVERRIDE; |
32 virtual void Get(const std::string& key, scoped_ptr<Callback> data_ready) | 33 virtual void Get(const std::string& key, scoped_ptr<Callback> data_ready) |
33 const OVERRIDE; | 34 const OVERRIDE; |
34 | 35 |
35 // PrefStore::Observer implementation. | 36 // PrefStore::Observer implementation. |
36 virtual void OnPrefValueChanged(const std::string& key) OVERRIDE; | 37 virtual void OnPrefValueChanged(const std::string& key) OVERRIDE; |
37 virtual void OnInitializationCompleted(bool succeeded) OVERRIDE; | 38 virtual void OnInitializationCompleted(bool succeeded) OVERRIDE; |
38 | 39 |
39 private: | 40 private: |
40 struct Request { | 41 struct Request { |
41 Request(const std::string& key, scoped_ptr<Callback> callback); | 42 Request(const std::string& key, scoped_ptr<Callback> callback); |
(...skipping 11 matching lines...) Expand all Loading... |
53 ScopedVector<Request> outstanding_requests_; | 54 ScopedVector<Request> outstanding_requests_; |
54 | 55 |
55 ScopedObserver<PrefStore, ChromeStorageImpl> scoped_observer_; | 56 ScopedObserver<PrefStore, ChromeStorageImpl> scoped_observer_; |
56 | 57 |
57 DISALLOW_COPY_AND_ASSIGN(ChromeStorageImpl); | 58 DISALLOW_COPY_AND_ASSIGN(ChromeStorageImpl); |
58 }; | 59 }; |
59 | 60 |
60 } // namespace autofill | 61 } // namespace autofill |
61 | 62 |
62 #endif // THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_CHROME_STORAGE_IMPL_H_ | 63 #endif // THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_CHROME_STORAGE_IMPL_H_ |
OLD | NEW |