Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Side by Side Diff: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc

Issue 1016113002: Instrument "Remove this person" in user manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ChromeOS Supervised User creation/deletion browser tests. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/profiler/scoped_tracker.h" 9 #include "base/profiler/scoped_tracker.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 const char kKeyNeedsSignin[] = "needsSignin"; 68 const char kKeyNeedsSignin[] = "needsSignin";
69 69
70 // JS API callback names. 70 // JS API callback names.
71 const char kJsApiUserManagerInitialize[] = "userManagerInitialize"; 71 const char kJsApiUserManagerInitialize[] = "userManagerInitialize";
72 const char kJsApiUserManagerAddUser[] = "addUser"; 72 const char kJsApiUserManagerAddUser[] = "addUser";
73 const char kJsApiUserManagerAuthLaunchUser[] = "authenticatedLaunchUser"; 73 const char kJsApiUserManagerAuthLaunchUser[] = "authenticatedLaunchUser";
74 const char kJsApiUserManagerLaunchGuest[] = "launchGuest"; 74 const char kJsApiUserManagerLaunchGuest[] = "launchGuest";
75 const char kJsApiUserManagerLaunchUser[] = "launchUser"; 75 const char kJsApiUserManagerLaunchUser[] = "launchUser";
76 const char kJsApiUserManagerRemoveUser[] = "removeUser"; 76 const char kJsApiUserManagerRemoveUser[] = "removeUser";
77 const char kJsApiUserManagerAttemptUnlock[] = "attemptUnlock"; 77 const char kJsApiUserManagerAttemptUnlock[] = "attemptUnlock";
78 const char kJsApiUserManagerLogRemoveUserWarningShown[] =
79 "logRemoveUserWarningShown";
78 80
79 const size_t kAvatarIconSize = 180; 81 const size_t kAvatarIconSize = 180;
80 82
81 void HandleAndDoNothing(const base::ListValue* args) { 83 void HandleAndDoNothing(const base::ListValue* args) {
82 } 84 }
83 85
84 // This callback is run if the only profile has been deleted, and a new 86 // This callback is run if the only profile has been deleted, and a new
85 // profile has been created to replace it. 87 // profile has been created to replace it.
86 void OpenNewWindowForProfile( 88 void OpenNewWindowForProfile(
87 chrome::HostDesktopType desktop_type, 89 chrome::HostDesktopType desktop_type,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 if (hash_ == profiles::kUserManagerSelectProfileTaskManager) 207 if (hash_ == profiles::kUserManagerSelectProfileTaskManager)
206 chrome::OpenTaskManager(target_browser); 208 chrome::OpenTaskManager(target_browser);
207 else if (hash_ == profiles::kUserManagerSelectProfileAboutChrome) 209 else if (hash_ == profiles::kUserManagerSelectProfileAboutChrome)
208 chrome::ShowAboutChrome(target_browser); 210 chrome::ShowAboutChrome(target_browser);
209 else if (hash_ == profiles::kUserManagerSelectProfileChromeSettings) 211 else if (hash_ == profiles::kUserManagerSelectProfileChromeSettings)
210 chrome::ShowSettings(target_browser); 212 chrome::ShowSettings(target_browser);
211 else if (hash_ == profiles::kUserManagerSelectProfileChromeMemory) 213 else if (hash_ == profiles::kUserManagerSelectProfileChromeMemory)
212 chrome::ShowMemory(target_browser); 214 chrome::ShowMemory(target_browser);
213 } 215 }
214 216
217 void HandleLogRemoveUserWarningShown(const base::ListValue* args) {
218 ProfileMetrics::LogProfileDeleteUser(
219 ProfileMetrics::DELETE_PROFILE_USER_MANAGER_SHOW_WARNING);
220 }
221
215 } // namespace 222 } // namespace
216 223
217 // ProfileUpdateObserver ------------------------------------------------------ 224 // ProfileUpdateObserver ------------------------------------------------------
218 225
219 class UserManagerScreenHandler::ProfileUpdateObserver 226 class UserManagerScreenHandler::ProfileUpdateObserver
220 : public ProfileInfoCacheObserver { 227 : public ProfileInfoCacheObserver {
221 public: 228 public:
222 ProfileUpdateObserver( 229 ProfileUpdateObserver(
223 ProfileManager* profile_manager, UserManagerScreenHandler* handler) 230 ProfileManager* profile_manager, UserManagerScreenHandler* handler)
224 : profile_manager_(profile_manager), 231 : profile_manager_(profile_manager),
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 base::Unretained(this))); 594 base::Unretained(this)));
588 web_ui()->RegisterMessageCallback(kJsApiUserManagerLaunchUser, 595 web_ui()->RegisterMessageCallback(kJsApiUserManagerLaunchUser,
589 base::Bind(&UserManagerScreenHandler::HandleLaunchUser, 596 base::Bind(&UserManagerScreenHandler::HandleLaunchUser,
590 base::Unretained(this))); 597 base::Unretained(this)));
591 web_ui()->RegisterMessageCallback(kJsApiUserManagerRemoveUser, 598 web_ui()->RegisterMessageCallback(kJsApiUserManagerRemoveUser,
592 base::Bind(&UserManagerScreenHandler::HandleRemoveUser, 599 base::Bind(&UserManagerScreenHandler::HandleRemoveUser,
593 base::Unretained(this))); 600 base::Unretained(this)));
594 web_ui()->RegisterMessageCallback(kJsApiUserManagerAttemptUnlock, 601 web_ui()->RegisterMessageCallback(kJsApiUserManagerAttemptUnlock,
595 base::Bind(&UserManagerScreenHandler::HandleAttemptUnlock, 602 base::Bind(&UserManagerScreenHandler::HandleAttemptUnlock,
596 base::Unretained(this))); 603 base::Unretained(this)));
604 web_ui()->RegisterMessageCallback(kJsApiUserManagerLogRemoveUserWarningShown,
605 base::Bind(&HandleLogRemoveUserWarningShown));
597 606
598 const content::WebUI::MessageCallback& kDoNothingCallback = 607 const content::WebUI::MessageCallback& kDoNothingCallback =
599 base::Bind(&HandleAndDoNothing); 608 base::Bind(&HandleAndDoNothing);
600 609
601 // Unused callbacks from screen_account_picker.js 610 // Unused callbacks from screen_account_picker.js
602 web_ui()->RegisterMessageCallback("accountPickerReady", kDoNothingCallback); 611 web_ui()->RegisterMessageCallback("accountPickerReady", kDoNothingCallback);
603 web_ui()->RegisterMessageCallback("loginUIStateChanged", kDoNothingCallback); 612 web_ui()->RegisterMessageCallback("loginUIStateChanged", kDoNothingCallback);
604 web_ui()->RegisterMessageCallback("hideCaptivePortal", kDoNothingCallback); 613 web_ui()->RegisterMessageCallback("hideCaptivePortal", kDoNothingCallback);
605 web_ui()->RegisterMessageCallback("getTouchViewState", kDoNothingCallback); 614 web_ui()->RegisterMessageCallback("getTouchViewState", kDoNothingCallback);
606 // Unused callbacks from display_manager.js 615 // Unused callbacks from display_manager.js
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 Profile* profile, Profile::CreateStatus profile_create_status) { 850 Profile* profile, Profile::CreateStatus profile_create_status) {
842 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); 851 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_);
843 if (browser && browser->window()) { 852 if (browser && browser->window()) {
844 OnBrowserWindowReady(browser); 853 OnBrowserWindowReady(browser);
845 } else { 854 } else {
846 registrar_.Add(this, 855 registrar_.Add(this,
847 chrome::NOTIFICATION_BROWSER_WINDOW_READY, 856 chrome::NOTIFICATION_BROWSER_WINDOW_READY,
848 content::NotificationService::AllSources()); 857 content::NotificationService::AllSources());
849 } 858 }
850 } 859 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/manage_profile_handler.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698