| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" | 5 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/value_conversions.h" | 10 #include "base/value_conversions.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 virtual ~ProfileUpdateObserver() { | 166 virtual ~ProfileUpdateObserver() { |
| 167 DCHECK(profile_manager_); | 167 DCHECK(profile_manager_); |
| 168 profile_manager_->GetProfileInfoCache().RemoveObserver(this); | 168 profile_manager_->GetProfileInfoCache().RemoveObserver(this); |
| 169 } | 169 } |
| 170 | 170 |
| 171 private: | 171 private: |
| 172 // ProfileInfoCacheObserver implementation: | 172 // ProfileInfoCacheObserver implementation: |
| 173 // If any change has been made to a profile, propagate it to all the | 173 // If any change has been made to a profile, propagate it to all the |
| 174 // visible user manager screens. | 174 // visible user manager screens. |
| 175 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE { | 175 virtual void OnProfileAdded(const base::FilePath& profile_path) override { |
| 176 user_manager_handler_->SendUserList(); | 176 user_manager_handler_->SendUserList(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 virtual void OnProfileWasRemoved( | 179 virtual void OnProfileWasRemoved( |
| 180 const base::FilePath& profile_path, | 180 const base::FilePath& profile_path, |
| 181 const base::string16& profile_name) OVERRIDE { | 181 const base::string16& profile_name) override { |
| 182 // TODO(noms): Change 'SendUserList' to 'removeUser' JS-call when | 182 // TODO(noms): Change 'SendUserList' to 'removeUser' JS-call when |
| 183 // UserManager is able to find pod belonging to removed user. | 183 // UserManager is able to find pod belonging to removed user. |
| 184 user_manager_handler_->SendUserList(); | 184 user_manager_handler_->SendUserList(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 virtual void OnProfileNameChanged( | 187 virtual void OnProfileNameChanged( |
| 188 const base::FilePath& profile_path, | 188 const base::FilePath& profile_path, |
| 189 const base::string16& old_profile_name) OVERRIDE { | 189 const base::string16& old_profile_name) override { |
| 190 user_manager_handler_->SendUserList(); | 190 user_manager_handler_->SendUserList(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 virtual void OnProfileAvatarChanged( | 193 virtual void OnProfileAvatarChanged( |
| 194 const base::FilePath& profile_path) OVERRIDE { | 194 const base::FilePath& profile_path) override { |
| 195 user_manager_handler_->SendUserList(); | 195 user_manager_handler_->SendUserList(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 virtual void OnProfileSigninRequiredChanged( | 198 virtual void OnProfileSigninRequiredChanged( |
| 199 const base::FilePath& profile_path) OVERRIDE { | 199 const base::FilePath& profile_path) override { |
| 200 user_manager_handler_->SendUserList(); | 200 user_manager_handler_->SendUserList(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 ProfileManager* profile_manager_; | 203 ProfileManager* profile_manager_; |
| 204 | 204 |
| 205 UserManagerScreenHandler* user_manager_handler_; // Weak; owns us. | 205 UserManagerScreenHandler* user_manager_handler_; // Weak; owns us. |
| 206 | 206 |
| 207 DISALLOW_COPY_AND_ASSIGN(ProfileUpdateObserver); | 207 DISALLOW_COPY_AND_ASSIGN(ProfileUpdateObserver); |
| 208 }; | 208 }; |
| 209 | 209 |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 Profile* profile, Profile::CreateStatus profile_create_status) { | 754 Profile* profile, Profile::CreateStatus profile_create_status) { |
| 755 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); | 755 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); |
| 756 if (browser && browser->window()) { | 756 if (browser && browser->window()) { |
| 757 OnBrowserWindowReady(browser); | 757 OnBrowserWindowReady(browser); |
| 758 } else { | 758 } else { |
| 759 registrar_.Add(this, | 759 registrar_.Add(this, |
| 760 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 760 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
| 761 content::NotificationService::AllSources()); | 761 content::NotificationService::AllSources()); |
| 762 } | 762 } |
| 763 } | 763 } |
| OLD | NEW |