| 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 CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_SYNC_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_SYNC_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_SYNC_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_SYNC_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // Returns |true| if sync was initialized and prefs have actual state. | 53 // Returns |true| if sync was initialized and prefs have actual state. |
| 54 bool is_synced() const { return is_synced_; } | 54 bool is_synced() const { return is_synced_; } |
| 55 | 55 |
| 56 // Adds |observer| into observers list. | 56 // Adds |observer| into observers list. |
| 57 void AddObserver(Observer* observer); | 57 void AddObserver(Observer* observer); |
| 58 // Removes |observer| from observers list. | 58 // Removes |observer| from observers list. |
| 59 void RemoveObserver(Observer* observer); | 59 void RemoveObserver(Observer* observer); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 // PrefServiceSyncableObserver implementation. | 62 // PrefServiceSyncableObserver implementation. |
| 63 virtual void OnIsSyncingChanged() OVERRIDE; | 63 virtual void OnIsSyncingChanged() override; |
| 64 | 64 |
| 65 // content::NotificationObserver implementation. | 65 // content::NotificationObserver implementation. |
| 66 virtual void Observe(int type, | 66 virtual void Observe(int type, |
| 67 const content::NotificationSource& source, | 67 const content::NotificationSource& source, |
| 68 const content::NotificationDetails& details) OVERRIDE; | 68 const content::NotificationDetails& details) override; |
| 69 | 69 |
| 70 // Called after user profile was loaded. | 70 // Called after user profile was loaded. |
| 71 void OnProfileGained(Profile* profile); | 71 void OnProfileGained(Profile* profile); |
| 72 | 72 |
| 73 // Called when sync servise started it's work and we are able to sync needed | 73 // Called when sync servise started it's work and we are able to sync needed |
| 74 // preferences. | 74 // preferences. |
| 75 void OnInitialSync(); | 75 void OnInitialSync(); |
| 76 | 76 |
| 77 // Called when preference |pref_name| was changed.j | 77 // Called when preference |pref_name| was changed.j |
| 78 void OnPreferenceChanged(const std::string& pref_name); | 78 void OnPreferenceChanged(const std::string& pref_name); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 96 bool is_synced_; | 96 bool is_synced_; |
| 97 // Indicates if local user image changed during initialization. | 97 // Indicates if local user image changed during initialization. |
| 98 bool local_image_changed_; | 98 bool local_image_changed_; |
| 99 ObserverList<Observer> observer_list_; | 99 ObserverList<Observer> observer_list_; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // namespace chromeos | 102 } // namespace chromeos |
| 103 | 103 |
| 104 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_SYNC_OBSERVER_H
_ | 104 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_SYNC_OBSERVER_H
_ |
| 105 | 105 |
| OLD | NEW |