OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_SERVICE_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_SERVICE_OBSERVER_H_ |
6 #define CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_SERVICE_OBSERVER_H_ | 6 #define CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_SERVICE_OBSERVER_H_ |
7 | 7 |
8 // Observer for OneGoogleBarService. | 8 // Observer for OneGoogleBarService. |
9 class OneGoogleBarServiceObserver { | 9 class OneGoogleBarServiceObserver { |
10 public: | 10 public: |
11 // Called when the OneGoogleBarData changes. You can get the new data via | 11 // Called when the OneGoogleBarData changes, including changes between null |
| 12 // and non-null. You can get the new data via |
12 // OneGoogleBarService::one_google_bar_data(). | 13 // OneGoogleBarService::one_google_bar_data(). |
13 virtual void OnOneGoogleBarDataChanged() = 0; | 14 virtual void OnOneGoogleBarDataChanged() = 0; |
| 15 |
| 16 // Called when an attempt to fetch the OneGoogleBarData failed. Note that if |
| 17 // there was cached data before the failed fetch attempt, then |
| 18 // OnOneGoogleBarDataChanged gets called first. |
| 19 virtual void OnOneGoogleBarFetchFailed() {} |
| 20 |
| 21 // Called when the OneGoogleBarService is shutting down. Observers that might |
| 22 // outlive the service should use this to unregister themselves, and clear out |
| 23 // any pointers to the service they might hold. |
| 24 virtual void OnOneGoogleBarServiceShuttingDown() {} |
14 }; | 25 }; |
15 | 26 |
16 #endif // CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_SERVICE_OBSERVER_
H_ | 27 #endif // CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_SERVICE_OBSERVER_
H_ |
OLD | NEW |