| 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/value_conversions.h" | 8 #include "base/value_conversions.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 } | 133 } |
| 134 | 134 |
| 135 virtual void OnProfileWasRemoved( | 135 virtual void OnProfileWasRemoved( |
| 136 const base::FilePath& profile_path, | 136 const base::FilePath& profile_path, |
| 137 const base::string16& profile_name) OVERRIDE { | 137 const base::string16& profile_name) OVERRIDE { |
| 138 // TODO(noms): Change 'SendUserList' to 'removeUser' JS-call when | 138 // TODO(noms): Change 'SendUserList' to 'removeUser' JS-call when |
| 139 // UserManager is able to find pod belonging to removed user. | 139 // UserManager is able to find pod belonging to removed user. |
| 140 user_manager_handler_->SendUserList(); | 140 user_manager_handler_->SendUserList(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 virtual void OnProfileWillBeRemoved( | |
| 144 const base::FilePath& profile_path) OVERRIDE { | |
| 145 // No-op. When the profile is actually removed, OnProfileWasRemoved | |
| 146 // will be called. | |
| 147 } | |
| 148 | |
| 149 virtual void OnProfileNameChanged( | 143 virtual void OnProfileNameChanged( |
| 150 const base::FilePath& profile_path, | 144 const base::FilePath& profile_path, |
| 151 const base::string16& old_profile_name) OVERRIDE { | 145 const base::string16& old_profile_name) OVERRIDE { |
| 152 user_manager_handler_->SendUserList(); | 146 user_manager_handler_->SendUserList(); |
| 153 } | 147 } |
| 154 | 148 |
| 155 virtual void OnProfileAvatarChanged( | 149 virtual void OnProfileAvatarChanged( |
| 156 const base::FilePath& profile_path) OVERRIDE { | 150 const base::FilePath& profile_path) OVERRIDE { |
| 157 user_manager_handler_->SendUserList(); | 151 user_manager_handler_->SendUserList(); |
| 158 } | 152 } |
| 159 | 153 |
| 154 virtual void OnProfileSigninRequiredChanged( |
| 155 const base::FilePath& profile_path) OVERRIDE { |
| 156 user_manager_handler_->SendUserList(); |
| 157 } |
| 158 |
| 160 ProfileManager* profile_manager_; | 159 ProfileManager* profile_manager_; |
| 161 | 160 |
| 162 UserManagerScreenHandler* user_manager_handler_; // Weak; owns us. | 161 UserManagerScreenHandler* user_manager_handler_; // Weak; owns us. |
| 163 | 162 |
| 164 DISALLOW_COPY_AND_ASSIGN(ProfileUpdateObserver); | 163 DISALLOW_COPY_AND_ASSIGN(ProfileUpdateObserver); |
| 165 }; | 164 }; |
| 166 | 165 |
| 167 // UserManagerScreenHandler --------------------------------------------------- | 166 // UserManagerScreenHandler --------------------------------------------------- |
| 168 | 167 |
| 169 UserManagerScreenHandler::UserManagerScreenHandler() | 168 UserManagerScreenHandler::UserManagerScreenHandler() |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 // The row of user pods should display the active user first. | 410 // The row of user pods should display the active user first. |
| 412 if (is_active_user) | 411 if (is_active_user) |
| 413 users_list.Insert(0, profile_value); | 412 users_list.Insert(0, profile_value); |
| 414 else | 413 else |
| 415 users_list.Append(profile_value); | 414 users_list.Append(profile_value); |
| 416 } | 415 } |
| 417 | 416 |
| 418 web_ui()->CallJavascriptFunction("login.AccountPickerScreen.loadUsers", | 417 web_ui()->CallJavascriptFunction("login.AccountPickerScreen.loadUsers", |
| 419 users_list, base::FundamentalValue(false), base::FundamentalValue(true)); | 418 users_list, base::FundamentalValue(false), base::FundamentalValue(true)); |
| 420 } | 419 } |
| OLD | NEW |