| OLD | NEW |
| 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 "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/signin/signin_header_helper.h" |
| 10 #include "chrome/browser/signin/signin_manager_factory.h" | 11 #include "chrome/browser/signin/signin_manager_factory.h" |
| 11 #include "chrome/browser/signin/signin_promo.h" | 12 #include "chrome/browser/signin/signin_promo.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" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // Global errors don't show up in the wrench menu on android. | 93 // Global errors don't show up in the wrench menu on android. |
| 93 #if !defined(OS_ANDROID) | 94 #if !defined(OS_ANDROID) |
| 94 LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile(profile_); | 95 LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile(profile_); |
| 95 if (login_ui->current_login_ui()) { | 96 if (login_ui->current_login_ui()) { |
| 96 login_ui->current_login_ui()->FocusUI(); | 97 login_ui->current_login_ui()->FocusUI(); |
| 97 return; | 98 return; |
| 98 } | 99 } |
| 99 | 100 |
| 100 if (switches::IsNewProfileManagement()) { | 101 if (switches::IsNewProfileManagement()) { |
| 101 browser->window()->ShowAvatarBubbleFromAvatarButton( | 102 browser->window()->ShowAvatarBubbleFromAvatarButton( |
| 102 BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH); | 103 BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH, |
| 104 signin::GAIA_SERVICE_TYPE_NONE); |
| 103 } else { | 105 } else { |
| 104 chrome::ShowSingletonTab( | 106 chrome::ShowSingletonTab( |
| 105 browser, | 107 browser, |
| 106 signin::GetReauthURL(profile_, error_controller_->error_account_id())); | 108 signin::GetReauthURL(profile_, error_controller_->error_account_id())); |
| 107 } | 109 } |
| 108 #endif | 110 #endif |
| 109 } | 111 } |
| 110 | 112 |
| 111 bool SigninGlobalError::HasBubbleView() { | 113 bool SigninGlobalError::HasBubbleView() { |
| 112 return !GetBubbleViewMessages().empty(); | 114 return !GetBubbleViewMessages().empty(); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 ExecuteMenuItem(browser); | 182 ExecuteMenuItem(browser); |
| 181 } | 183 } |
| 182 | 184 |
| 183 void SigninGlobalError::BubbleViewCancelButtonPressed(Browser* browser) { | 185 void SigninGlobalError::BubbleViewCancelButtonPressed(Browser* browser) { |
| 184 NOTREACHED(); | 186 NOTREACHED(); |
| 185 } | 187 } |
| 186 | 188 |
| 187 void SigninGlobalError::OnErrorChanged() { | 189 void SigninGlobalError::OnErrorChanged() { |
| 188 GlobalErrorServiceFactory::GetForProfile(profile_)->NotifyErrorsChanged(this); | 190 GlobalErrorServiceFactory::GetForProfile(profile_)->NotifyErrorsChanged(this); |
| 189 } | 191 } |
| OLD | NEW |