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" |
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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 IDS_LOGIN_ERROR_AUTHENTICATING)), | 718 IDS_LOGIN_ERROR_AUTHENTICATING)), |
718 base::StringValue(""), | 719 base::StringValue(""), |
719 base::FundamentalValue(0)); | 720 base::FundamentalValue(0)); |
720 } | 721 } |
721 } | 722 } |
722 | 723 |
723 void UserManagerScreenHandler::OnBrowserWindowReady(Browser* browser) { | 724 void UserManagerScreenHandler::OnBrowserWindowReady(Browser* browser) { |
724 DCHECK(browser); | 725 DCHECK(browser); |
725 DCHECK(browser->window()); | 726 DCHECK(browser->window()); |
726 if (url_hash_ == profiles::kUserManagerSelectProfileTaskManager) { | 727 if (url_hash_ == profiles::kUserManagerSelectProfileTaskManager) { |
727 base::MessageLoop::current()->PostTask( | 728 base::MessageLoop::current()->PostTask( |
728 FROM_HERE, base::Bind(&chrome::ShowTaskManager, browser)); | 729 FROM_HERE, base::Bind(&chrome::OpenTaskManager, browser)); |
729 } else if (url_hash_ == profiles::kUserManagerSelectProfileAboutChrome) { | 730 } else if (url_hash_ == profiles::kUserManagerSelectProfileAboutChrome) { |
730 base::MessageLoop::current()->PostTask( | 731 base::MessageLoop::current()->PostTask( |
731 FROM_HERE, base::Bind(&chrome::ShowAboutChrome, browser)); | 732 FROM_HERE, base::Bind(&chrome::ShowAboutChrome, browser)); |
| 733 } else if (url_hash_ == profiles::kUserManagerSelectProfileChromeSettings) { |
| 734 base::MessageLoop::current()->PostTask( |
| 735 FROM_HERE, base::Bind(&chrome::ShowSettings, browser)); |
| 736 } else if (url_hash_ == profiles::kUserManagerSelectProfileChromeMemory) { |
| 737 base::MessageLoop::current()->PostTask( |
| 738 FROM_HERE, base::Bind(&chrome::ShowMemory, browser)); |
732 } | 739 } |
733 | 740 |
734 // This call is last as it deletes this object. | 741 // This call is last as it deletes this object. |
735 UserManager::Hide(); | 742 UserManager::Hide(); |
736 } | 743 } |
737 | 744 |
738 void UserManagerScreenHandler::Observe( | 745 void UserManagerScreenHandler::Observe( |
739 int type, | 746 int type, |
740 const content::NotificationSource& source, | 747 const content::NotificationSource& source, |
741 const content::NotificationDetails& details) { | 748 const content::NotificationDetails& details) { |
(...skipping 19 matching lines...) Expand all Loading... |
761 Profile* profile, Profile::CreateStatus profile_create_status) { | 768 Profile* profile, Profile::CreateStatus profile_create_status) { |
762 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); | 769 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); |
763 if (browser && browser->window()) { | 770 if (browser && browser->window()) { |
764 OnBrowserWindowReady(browser); | 771 OnBrowserWindowReady(browser); |
765 } else { | 772 } else { |
766 registrar_.Add(this, | 773 registrar_.Add(this, |
767 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 774 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
768 content::NotificationService::AllSources()); | 775 content::NotificationService::AllSources()); |
769 } | 776 } |
770 } | 777 } |
OLD | NEW |