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

Side by Side Diff: chrome/browser/signin/signin_global_error.cc

Issue 777143003: Clean up straggler classes to use embedded signin in page in the new profiles world. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years 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
« no previous file with comments | « chrome/browser/signin/signin_browsertest.cc ('k') | chrome/browser/signin/signin_promo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/signin/signin_global_error.h" 5 #include "chrome/browser/signin/signin_global_error.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram_macros.h"
8 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/signin/signin_header_helper.h" 11 #include "chrome/browser/signin/signin_header_helper.h"
11 #include "chrome/browser/signin/signin_manager_factory.h" 12 #include "chrome/browser/signin/signin_manager_factory.h"
12 #include "chrome/browser/ui/browser_commands.h" 13 #include "chrome/browser/ui/browser_commands.h"
13 #include "chrome/browser/ui/browser_window.h" 14 #include "chrome/browser/ui/browser_window.h"
14 #include "chrome/browser/ui/chrome_pages.h" 15 #include "chrome/browser/ui/chrome_pages.h"
15 #include "chrome/browser/ui/global_error/global_error_service.h" 16 #include "chrome/browser/ui/global_error/global_error_service.h"
16 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 17 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
17 #include "chrome/browser/ui/singleton_tabs.h" 18 #include "chrome/browser/ui/singleton_tabs.h"
18 #include "chrome/browser/ui/webui/signin/login_ui_service.h" 19 #include "chrome/browser/ui/webui/signin/login_ui_service.h"
19 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" 20 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
20 #include "chrome/common/url_constants.h" 21 #include "chrome/common/url_constants.h"
21 #include "chrome/grit/chromium_strings.h" 22 #include "chrome/grit/chromium_strings.h"
22 #include "chrome/grit/generated_resources.h" 23 #include "chrome/grit/generated_resources.h"
23 #include "components/signin/core/browser/signin_manager.h" 24 #include "components/signin/core/browser/signin_manager.h"
25 #include "components/signin/core/browser/signin_metrics.h"
24 #include "components/signin/core/common/profile_management_switches.h" 26 #include "components/signin/core/common/profile_management_switches.h"
25 #include "net/base/url_util.h" 27 #include "net/base/url_util.h"
26 #include "ui/base/l10n/l10n_util.h" 28 #include "ui/base/l10n/l10n_util.h"
27 29
28 #if !defined(OS_ANDROID) && !defined(OS_IOS) 30 #if !defined(OS_ANDROID) && !defined(OS_IOS)
29 #include "chrome/browser/signin/signin_promo.h" 31 #include "chrome/browser/signin/signin_promo.h"
30 #endif 32 #endif
31 33
32 SigninGlobalError::SigninGlobalError( 34 SigninGlobalError::SigninGlobalError(
33 SigninErrorController* error_controller, 35 SigninErrorController* error_controller,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 #endif 96 #endif
95 97
96 // Global errors don't show up in the wrench menu on mobile. 98 // Global errors don't show up in the wrench menu on mobile.
97 #if !defined(OS_ANDROID) && !defined(OS_IOS) 99 #if !defined(OS_ANDROID) && !defined(OS_IOS)
98 LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile(profile_); 100 LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile(profile_);
99 if (login_ui->current_login_ui()) { 101 if (login_ui->current_login_ui()) {
100 login_ui->current_login_ui()->FocusUI(); 102 login_ui->current_login_ui()->FocusUI();
101 return; 103 return;
102 } 104 }
103 105
106 UMA_HISTOGRAM_ENUMERATION("Signin.Reauth",
107 signin_metrics::HISTOGRAM_REAUTH_SHOWN,
108 signin_metrics::HISTOGRAM_REAUTH_MAX);
104 if (switches::IsNewAvatarMenu()) { 109 if (switches::IsNewAvatarMenu()) {
105 browser->window()->ShowAvatarBubbleFromAvatarButton( 110 browser->window()->ShowAvatarBubbleFromAvatarButton(
106 BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH, 111 BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH,
107 signin::ManageAccountsParams()); 112 signin::ManageAccountsParams());
108 } else { 113 } else {
109 chrome::ShowSingletonTab( 114 chrome::ShowSingletonTab(
110 browser, 115 browser,
111 signin::GetReauthURL(profile_, error_controller_->error_account_id())); 116 signin::GetReauthURL(profile_, error_controller_->error_account_id()));
112 } 117 }
113 #endif 118 #endif
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 ExecuteMenuItem(browser); 187 ExecuteMenuItem(browser);
183 } 188 }
184 189
185 void SigninGlobalError::BubbleViewCancelButtonPressed(Browser* browser) { 190 void SigninGlobalError::BubbleViewCancelButtonPressed(Browser* browser) {
186 NOTREACHED(); 191 NOTREACHED();
187 } 192 }
188 193
189 void SigninGlobalError::OnErrorChanged() { 194 void SigninGlobalError::OnErrorChanged() {
190 GlobalErrorServiceFactory::GetForProfile(profile_)->NotifyErrorsChanged(this); 195 GlobalErrorServiceFactory::GetForProfile(profile_)->NotifyErrorsChanged(this);
191 } 196 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_browsertest.cc ('k') | chrome/browser/signin/signin_promo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698