Chromium Code Reviews| 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" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 #include "chrome/browser/ui/browser_finder.h" | 25 #include "chrome/browser/ui/browser_finder.h" |
| 26 #include "chrome/browser/ui/browser_list.h" | 26 #include "chrome/browser/ui/browser_list.h" |
| 27 #include "chrome/browser/ui/chrome_pages.h" | 27 #include "chrome/browser/ui/chrome_pages.h" |
| 28 #include "chrome/browser/ui/singleton_tabs.h" | 28 #include "chrome/browser/ui/singleton_tabs.h" |
| 29 #include "chrome/browser/ui/user_manager.h" | 29 #include "chrome/browser/ui/user_manager.h" |
| 30 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
| 31 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
| 32 #include "chrome/grit/chromium_strings.h" | 32 #include "chrome/grit/chromium_strings.h" |
| 33 #include "chrome/grit/generated_resources.h" | 33 #include "chrome/grit/generated_resources.h" |
| 34 #include "content/public/browser/notification_service.h" | 34 #include "content/public/browser/notification_service.h" |
| 35 #include "content/public/browser/user_metrics.h" | |
| 35 #include "content/public/browser/web_contents.h" | 36 #include "content/public/browser/web_contents.h" |
| 36 #include "content/public/browser/web_ui.h" | 37 #include "content/public/browser/web_ui.h" |
| 37 #include "google_apis/gaia/gaia_auth_fetcher.h" | 38 #include "google_apis/gaia/gaia_auth_fetcher.h" |
| 38 #include "google_apis/gaia/gaia_constants.h" | 39 #include "google_apis/gaia/gaia_constants.h" |
| 39 #include "third_party/skia/include/core/SkBitmap.h" | 40 #include "third_party/skia/include/core/SkBitmap.h" |
| 40 #include "ui/base/l10n/l10n_util.h" | 41 #include "ui/base/l10n/l10n_util.h" |
| 41 #include "ui/base/resource/resource_bundle.h" | 42 #include "ui/base/resource/resource_bundle.h" |
| 42 #include "ui/base/webui/web_ui_util.h" | 43 #include "ui/base/webui/web_ui_util.h" |
| 43 #include "ui/gfx/image/image.h" | 44 #include "ui/gfx/image/image.h" |
| 44 #include "ui/gfx/image/image_skia.h" | 45 #include "ui/gfx/image/image_skia.h" |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 content::RecordAction(base::UserMetricsAction("TaskManager")); |
|
Mark Mentovai
2014/10/07 20:22:57
Seems weird that some things have their UMA action
Mike Lerman
2014/10/08 15:41:37
This generally happens in the chrome::OpenTaskMana
| |
| 721 FROM_HERE, base::Bind(&chrome::ShowTaskManager, browser)); | 722 base::MessageLoop::current()->PostTask( |
| 723 FROM_HERE, base::Bind(&chrome::ShowTaskManager, browser)); | |
| 722 } else if (url_hash_ == profiles::kUserManagerSelectProfileAboutChrome) { | 724 } else if (url_hash_ == profiles::kUserManagerSelectProfileAboutChrome) { |
| 723 base::MessageLoop::current()->PostTask( | 725 base::MessageLoop::current()->PostTask( |
| 724 FROM_HERE, base::Bind(&chrome::ShowAboutChrome, browser)); | 726 FROM_HERE, base::Bind(&chrome::ShowAboutChrome, browser)); |
| 727 } else if (url_hash_ == profiles::kUserManagerSelectProfileChromeSettings) { | |
| 728 base::MessageLoop::current()->PostTask( | |
| 729 FROM_HERE, base::Bind(&chrome::ShowSettings, browser)); | |
| 725 } | 730 } |
| 726 | 731 |
| 727 // This call is last as it deletes this object. | 732 // This call is last as it deletes this object. |
| 728 UserManager::Hide(); | 733 UserManager::Hide(); |
| 729 } | 734 } |
| 730 | 735 |
| 731 void UserManagerScreenHandler::Observe( | 736 void UserManagerScreenHandler::Observe( |
| 732 int type, | 737 int type, |
| 733 const content::NotificationSource& source, | 738 const content::NotificationSource& source, |
| 734 const content::NotificationDetails& details) { | 739 const content::NotificationDetails& details) { |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 754 Profile* profile, Profile::CreateStatus profile_create_status) { | 759 Profile* profile, Profile::CreateStatus profile_create_status) { |
| 755 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); | 760 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); |
| 756 if (browser && browser->window()) { | 761 if (browser && browser->window()) { |
| 757 OnBrowserWindowReady(browser); | 762 OnBrowserWindowReady(browser); |
| 758 } else { | 763 } else { |
| 759 registrar_.Add(this, | 764 registrar_.Add(this, |
| 760 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 765 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
| 761 content::NotificationService::AllSources()); | 766 content::NotificationService::AllSources()); |
| 762 } | 767 } |
| 763 } | 768 } |
| OLD | NEW |