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 <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "components/syncable_prefs/pref_service_syncable_observer.h" | 12 #include "components/syncable_prefs/pref_service_syncable_observer.h" |
13 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
14 | 14 |
15 class PrefChangeRegistrar; | 15 class PrefChangeRegistrar; |
16 class Profile; | 16 class Profile; |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 class NotificationRegistrar; | 19 class NotificationRegistrar; |
20 } | 20 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // Saves sync preferences to local state and updates user image. | 88 // Saves sync preferences to local state and updates user image. |
89 void UpdateLocalImageFromSynced(); | 89 void UpdateLocalImageFromSynced(); |
90 | 90 |
91 // Gets synced image index. Returns false if user has no needed preferences. | 91 // Gets synced image index. Returns false if user has no needed preferences. |
92 bool GetSyncedImageIndex(int* result); | 92 bool GetSyncedImageIndex(int* result); |
93 | 93 |
94 // If it is allowed to change user image now. | 94 // If it is allowed to change user image now. |
95 bool CanUpdateLocalImageNow(); | 95 bool CanUpdateLocalImageNow(); |
96 | 96 |
97 const user_manager::User* user_; | 97 const user_manager::User* user_; |
98 scoped_ptr<PrefChangeRegistrar> pref_change_registrar_; | 98 std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_; |
99 scoped_ptr<content::NotificationRegistrar> notification_registrar_; | 99 std::unique_ptr<content::NotificationRegistrar> notification_registrar_; |
100 syncable_prefs::PrefServiceSyncable* prefs_; | 100 syncable_prefs::PrefServiceSyncable* prefs_; |
101 bool is_synced_; | 101 bool is_synced_; |
102 // Indicates if local user image changed during initialization. | 102 // Indicates if local user image changed during initialization. |
103 bool local_image_changed_; | 103 bool local_image_changed_; |
104 base::ObserverList<Observer> observer_list_; | 104 base::ObserverList<Observer> observer_list_; |
105 }; | 105 }; |
106 | 106 |
107 } // namespace chromeos | 107 } // namespace chromeos |
108 | 108 |
109 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_SYNC_OBSERVER_H
_ | 109 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AVATAR_USER_IMAGE_SYNC_OBSERVER_H
_ |
110 | 110 |
OLD | NEW |