OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/options/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/options/sync_setup_handler.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 GURL url; | 362 GURL url; |
363 if (SigninManagerFactory::GetForProfile( | 363 if (SigninManagerFactory::GetForProfile( |
364 browser->profile())->IsAuthenticated()) { | 364 browser->profile())->IsAuthenticated()) { |
365 UMA_HISTOGRAM_ENUMERATION("Signin.Reauth", | 365 UMA_HISTOGRAM_ENUMERATION("Signin.Reauth", |
366 signin_metrics::HISTOGRAM_REAUTH_SHOWN, | 366 signin_metrics::HISTOGRAM_REAUTH_SHOWN, |
367 signin_metrics::HISTOGRAM_REAUTH_MAX); | 367 signin_metrics::HISTOGRAM_REAUTH_MAX); |
368 | 368 |
369 SigninErrorController* error_controller = | 369 SigninErrorController* error_controller = |
370 SigninErrorControllerFactory::GetForProfile(browser->profile()); | 370 SigninErrorControllerFactory::GetForProfile(browser->profile()); |
371 DCHECK(error_controller->HasError()); | 371 DCHECK(error_controller->HasError()); |
372 if (switches::IsNewAvatarMenu() && !force_new_tab) { | 372 if (!force_new_tab) { |
373 browser->window()->ShowAvatarBubbleFromAvatarButton( | 373 browser->window()->ShowAvatarBubbleFromAvatarButton( |
374 BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH, | 374 BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH, |
375 signin::ManageAccountsParams()); | 375 signin::ManageAccountsParams()); |
376 } else { | 376 } else { |
377 url = signin::GetReauthURL(browser->profile(), | 377 url = signin::GetReauthURL(browser->profile(), |
378 error_controller->error_account_id()); | 378 error_controller->error_account_id()); |
379 } | 379 } |
380 } else { | 380 } else { |
381 signin_metrics::LogSigninSource(signin_metrics::SOURCE_SETTINGS); | 381 signin_metrics::LogSigninSource(signin_metrics::SOURCE_SETTINGS); |
382 if (switches::IsNewAvatarMenu() && !force_new_tab) { | 382 if (!force_new_tab) { |
383 browser->window()->ShowAvatarBubbleFromAvatarButton( | 383 browser->window()->ShowAvatarBubbleFromAvatarButton( |
384 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, | 384 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, |
385 signin::ManageAccountsParams()); | 385 signin::ManageAccountsParams()); |
386 } else { | 386 } else { |
387 url = signin::GetPromoURL(signin_metrics::SOURCE_SETTINGS, true); | 387 url = signin::GetPromoURL(signin_metrics::SOURCE_SETTINGS, true); |
388 } | 388 } |
389 } | 389 } |
390 | 390 |
391 if (url.is_valid()) | 391 if (url.is_valid()) |
392 chrome::ShowSingletonTab(browser, url); | 392 chrome::ShowSingletonTab(browser, url); |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 "SyncSetupOverlay.showSyncSetupPage", page, args); | 920 "SyncSetupOverlay.showSyncSetupPage", page, args); |
921 | 921 |
922 // Make sure the tab used for the Gaia sign in does not cover the settings | 922 // Make sure the tab used for the Gaia sign in does not cover the settings |
923 // tab. | 923 // tab. |
924 FocusUI(); | 924 FocusUI(); |
925 } | 925 } |
926 | 926 |
927 LoginUIService* SyncSetupHandler::GetLoginUIService() const { | 927 LoginUIService* SyncSetupHandler::GetLoginUIService() const { |
928 return LoginUIServiceFactory::GetForProfile(GetProfile()); | 928 return LoginUIServiceFactory::GetForProfile(GetProfile()); |
929 } | 929 } |
OLD | NEW |