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

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

Issue 631163004: Mac - show user manager before opening browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chrome Memory now forces user manager, not Task Manager Created 6 years, 2 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/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"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/chrome_notification_types.h" 13 #include "chrome/browser/chrome_notification_types.h"
14 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap i.h" 14 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap i.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/profiles/profile_avatar_icon_util.h" 16 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
17 #include "chrome/browser/profiles/profile_info_cache.h" 17 #include "chrome/browser/profiles/profile_info_cache.h"
18 #include "chrome/browser/profiles/profile_info_cache_observer.h" 18 #include "chrome/browser/profiles/profile_info_cache_observer.h"
19 #include "chrome/browser/profiles/profile_manager.h" 19 #include "chrome/browser/profiles/profile_manager.h"
20 #include "chrome/browser/profiles/profile_metrics.h" 20 #include "chrome/browser/profiles/profile_metrics.h"
21 #include "chrome/browser/profiles/profile_window.h" 21 #include "chrome/browser/profiles/profile_window.h"
22 #include "chrome/browser/profiles/profiles_state.h" 22 #include "chrome/browser/profiles/profiles_state.h"
23 #include "chrome/browser/signin/local_auth.h" 23 #include "chrome/browser/signin/local_auth.h"
24 #include "chrome/browser/ui/browser_commands.h"
24 #include "chrome/browser/ui/browser_dialogs.h" 25 #include "chrome/browser/ui/browser_dialogs.h"
25 #include "chrome/browser/ui/browser_finder.h" 26 #include "chrome/browser/ui/browser_finder.h"
26 #include "chrome/browser/ui/browser_list.h" 27 #include "chrome/browser/ui/browser_list.h"
27 #include "chrome/browser/ui/chrome_pages.h" 28 #include "chrome/browser/ui/chrome_pages.h"
28 #include "chrome/browser/ui/singleton_tabs.h" 29 #include "chrome/browser/ui/singleton_tabs.h"
29 #include "chrome/browser/ui/user_manager.h" 30 #include "chrome/browser/ui/user_manager.h"
30 #include "chrome/common/pref_names.h" 31 #include "chrome/common/pref_names.h"
31 #include "chrome/common/url_constants.h" 32 #include "chrome/common/url_constants.h"
32 #include "chrome/grit/chromium_strings.h" 33 #include "chrome/grit/chromium_strings.h"
33 #include "chrome/grit/generated_resources.h" 34 #include "chrome/grit/generated_resources.h"
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 IDS_LOGIN_ERROR_AUTHENTICATING)), 711 IDS_LOGIN_ERROR_AUTHENTICATING)),
711 base::StringValue(""), 712 base::StringValue(""),
712 base::FundamentalValue(0)); 713 base::FundamentalValue(0));
713 } 714 }
714 } 715 }
715 716
716 void UserManagerScreenHandler::OnBrowserWindowReady(Browser* browser) { 717 void UserManagerScreenHandler::OnBrowserWindowReady(Browser* browser) {
717 DCHECK(browser); 718 DCHECK(browser);
718 DCHECK(browser->window()); 719 DCHECK(browser->window());
719 if (url_hash_ == profiles::kUserManagerSelectProfileTaskManager) { 720 if (url_hash_ == profiles::kUserManagerSelectProfileTaskManager) {
720 base::MessageLoop::current()->PostTask( 721 base::MessageLoop::current()->PostTask(
721 FROM_HERE, base::Bind(&chrome::ShowTaskManager, browser)); 722 FROM_HERE, base::Bind(&chrome::OpenTaskManager, browser));
722 } else if (url_hash_ == profiles::kUserManagerSelectProfileAboutChrome) { 723 } else if (url_hash_ == profiles::kUserManagerSelectProfileAboutChrome) {
723 base::MessageLoop::current()->PostTask( 724 base::MessageLoop::current()->PostTask(
724 FROM_HERE, base::Bind(&chrome::ShowAboutChrome, browser)); 725 FROM_HERE, base::Bind(&chrome::ShowAboutChrome, browser));
726 } else if (url_hash_ == profiles::kUserManagerSelectProfileChromeSettings) {
727 base::MessageLoop::current()->PostTask(
728 FROM_HERE, base::Bind(&chrome::ShowSettings, browser));
729 } else if (url_hash_ == profiles::kUserManagerSelectProfileChromeMemory) {
730 base::MessageLoop::current()->PostTask(
731 FROM_HERE, base::Bind(&chrome::ShowMemory, browser));
725 } 732 }
726 733
727 // This call is last as it deletes this object. 734 // This call is last as it deletes this object.
728 UserManager::Hide(); 735 UserManager::Hide();
729 } 736 }
730 737
731 void UserManagerScreenHandler::Observe( 738 void UserManagerScreenHandler::Observe(
732 int type, 739 int type,
733 const content::NotificationSource& source, 740 const content::NotificationSource& source,
734 const content::NotificationDetails& details) { 741 const content::NotificationDetails& details) {
(...skipping 19 matching lines...) Expand all
754 Profile* profile, Profile::CreateStatus profile_create_status) { 761 Profile* profile, Profile::CreateStatus profile_create_status) {
755 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); 762 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_);
756 if (browser && browser->window()) { 763 if (browser && browser->window()) {
757 OnBrowserWindowReady(browser); 764 OnBrowserWindowReady(browser);
758 } else { 765 } else {
759 registrar_.Add(this, 766 registrar_.Add(this,
760 chrome::NOTIFICATION_BROWSER_WINDOW_READY, 767 chrome::NOTIFICATION_BROWSER_WINDOW_READY,
761 content::NotificationService::AllSources()); 768 content::NotificationService::AllSources());
762 } 769 }
763 } 770 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698