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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 DisplayGaiaLoginInNewTabOrWindow(access_point); | 360 DisplayGaiaLoginInNewTabOrWindow(access_point); |
361 } | 361 } |
362 | 362 |
363 void SyncSetupHandler::DisplayGaiaLoginInNewTabOrWindow( | 363 void SyncSetupHandler::DisplayGaiaLoginInNewTabOrWindow( |
364 signin_metrics::AccessPoint access_point) { | 364 signin_metrics::AccessPoint access_point) { |
365 Browser* browser = chrome::FindBrowserWithWebContents( | 365 Browser* browser = chrome::FindBrowserWithWebContents( |
366 web_ui()->GetWebContents()); | 366 web_ui()->GetWebContents()); |
367 bool force_new_tab = false; | 367 bool force_new_tab = false; |
368 if (!browser) { | 368 if (!browser) { |
369 // Settings is not displayed in a browser window. Open a new window. | 369 // Settings is not displayed in a browser window. Open a new window. |
370 browser = new Browser(Browser::CreateParams( | 370 browser = |
371 Browser::TYPE_TABBED, GetProfile(), chrome::GetActiveDesktop())); | 371 new Browser(Browser::CreateParams(Browser::TYPE_TABBED, GetProfile())); |
372 force_new_tab = true; | 372 force_new_tab = true; |
373 } | 373 } |
374 | 374 |
375 // If the signin manager already has an authenticated username, this is a | 375 // If the signin manager already has an authenticated username, this is a |
376 // re-auth scenario, and we need to ensure that the user signs in with the | 376 // re-auth scenario, and we need to ensure that the user signs in with the |
377 // same email address. | 377 // same email address. |
378 GURL url; | 378 GURL url; |
379 if (SigninManagerFactory::GetForProfile( | 379 if (SigninManagerFactory::GetForProfile( |
380 browser->profile())->IsAuthenticated()) { | 380 browser->profile())->IsAuthenticated()) { |
381 UMA_HISTOGRAM_ENUMERATION("Signin.Reauth", | 381 UMA_HISTOGRAM_ENUMERATION("Signin.Reauth", |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 "SyncSetupOverlay.showSyncSetupPage", page, args); | 962 "SyncSetupOverlay.showSyncSetupPage", page, args); |
963 | 963 |
964 // Make sure the tab used for the Gaia sign in does not cover the settings | 964 // Make sure the tab used for the Gaia sign in does not cover the settings |
965 // tab. | 965 // tab. |
966 FocusUI(); | 966 FocusUI(); |
967 } | 967 } |
968 | 968 |
969 LoginUIService* SyncSetupHandler::GetLoginUIService() const { | 969 LoginUIService* SyncSetupHandler::GetLoginUIService() const { |
970 return LoginUIServiceFactory::GetForProfile(GetProfile()); | 970 return LoginUIServiceFactory::GetForProfile(GetProfile()); |
971 } | 971 } |
OLD | NEW |