Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/options/manage_profile_handler.h" | 5 #include "chrome/browser/ui/webui/options/manage_profile_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 web_ui()->RegisterMessageCallback("removeProfileShortcut", | 178 web_ui()->RegisterMessageCallback("removeProfileShortcut", |
| 179 base::Bind(&ManageProfileHandler::RemoveProfileShortcut, | 179 base::Bind(&ManageProfileHandler::RemoveProfileShortcut, |
| 180 base::Unretained(this))); | 180 base::Unretained(this))); |
| 181 web_ui()->RegisterMessageCallback("refreshGaiaPicture", | 181 web_ui()->RegisterMessageCallback("refreshGaiaPicture", |
| 182 base::Bind(&ManageProfileHandler::RefreshGaiaPicture, | 182 base::Bind(&ManageProfileHandler::RefreshGaiaPicture, |
| 183 base::Unretained(this))); | 183 base::Unretained(this))); |
| 184 web_ui()->RegisterMessageCallback( | 184 web_ui()->RegisterMessageCallback( |
| 185 "showDisconnectManagedProfileDialog", | 185 "showDisconnectManagedProfileDialog", |
| 186 base::Bind(&ManageProfileHandler::ShowDisconnectManagedProfileDialog, | 186 base::Bind(&ManageProfileHandler::ShowDisconnectManagedProfileDialog, |
| 187 base::Unretained(this))); | 187 base::Unretained(this))); |
| 188 web_ui()->RegisterMessageCallback("showDeleteUserDialog", | |
| 189 base::Bind(&ManageProfileHandler::HandleDeleteUserDialogShown, | |
| 190 base::Unretained(this))); | |
| 188 } | 191 } |
| 189 | 192 |
| 190 void ManageProfileHandler::Uninitialize() { | 193 void ManageProfileHandler::Uninitialize() { |
| 191 g_browser_process->profile_manager()-> | 194 g_browser_process->profile_manager()-> |
| 192 GetProfileInfoCache().RemoveObserver(this); | 195 GetProfileInfoCache().RemoveObserver(this); |
| 193 } | 196 } |
| 194 | 197 |
| 195 void ManageProfileHandler::OnProfileAdded(const base::FilePath& profile_path) { | 198 void ManageProfileHandler::OnProfileAdded(const base::FilePath& profile_path) { |
| 196 SendExistingProfileNames(); | 199 SendExistingProfileNames(); |
| 197 } | 200 } |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 212 void ManageProfileHandler::OnProfileAvatarChanged( | 215 void ManageProfileHandler::OnProfileAvatarChanged( |
| 213 const base::FilePath& profile_path) { | 216 const base::FilePath& profile_path) { |
| 214 base::StringValue value(kManageProfileIdentifier); | 217 base::StringValue value(kManageProfileIdentifier); |
| 215 SendProfileIconsAndNames(value); | 218 SendProfileIconsAndNames(value); |
| 216 } | 219 } |
| 217 | 220 |
| 218 void ManageProfileHandler::OnStateChanged() { | 221 void ManageProfileHandler::OnStateChanged() { |
| 219 RequestCreateProfileUpdate(NULL); | 222 RequestCreateProfileUpdate(NULL); |
| 220 } | 223 } |
| 221 | 224 |
| 225 void ManageProfileHandler::HandleDeleteUserDialogShown( | |
|
Dan Beam
2015/03/18 22:36:33
instead of making this a private instance method,
| |
| 226 const base::ListValue* args) { | |
| 227 ProfileMetrics::LogProfileDeleteUser( | |
| 228 ProfileMetrics::DELETE_PROFILE_SETTINGS_SHOW_WARNING); | |
| 229 } | |
| 230 | |
| 222 void ManageProfileHandler::GenerateSignedinUserSpecificStrings( | 231 void ManageProfileHandler::GenerateSignedinUserSpecificStrings( |
| 223 base::DictionaryValue* dictionary) { | 232 base::DictionaryValue* dictionary) { |
| 224 std::string username; | 233 std::string username; |
| 225 std::string domain_name; | 234 std::string domain_name; |
| 226 | 235 |
| 227 #if !defined(OS_CHROMEOS) | 236 #if !defined(OS_CHROMEOS) |
| 228 Profile* profile = Profile::FromWebUI(web_ui()); | 237 Profile* profile = Profile::FromWebUI(web_ui()); |
| 229 DCHECK(profile); | 238 DCHECK(profile); |
| 230 SigninManagerBase* manager = SigninManagerFactory::GetForProfile(profile); | 239 SigninManagerBase* manager = SigninManagerFactory::GetForProfile(profile); |
| 231 if (manager) { | 240 if (manager) { |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 549 | 558 |
| 550 // Update the UI buttons. | 559 // Update the UI buttons. |
| 551 OnHasProfileShortcuts(false); | 560 OnHasProfileShortcuts(false); |
| 552 } | 561 } |
| 553 | 562 |
| 554 void ManageProfileHandler::RefreshGaiaPicture(const base::ListValue* args) { | 563 void ManageProfileHandler::RefreshGaiaPicture(const base::ListValue* args) { |
| 555 profiles::UpdateGaiaProfileInfoIfNeeded(Profile::FromWebUI(web_ui())); | 564 profiles::UpdateGaiaProfileInfoIfNeeded(Profile::FromWebUI(web_ui())); |
| 556 } | 565 } |
| 557 | 566 |
| 558 } // namespace options | 567 } // namespace options |
| OLD | NEW |