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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 DisplayGaiaLoginInNewTabOrWindow(access_point); | 356 DisplayGaiaLoginInNewTabOrWindow(access_point); |
357 } | 357 } |
358 | 358 |
359 void SyncSetupHandler::DisplayGaiaLoginInNewTabOrWindow( | 359 void SyncSetupHandler::DisplayGaiaLoginInNewTabOrWindow( |
360 signin_metrics::AccessPoint access_point) { | 360 signin_metrics::AccessPoint access_point) { |
361 Browser* browser = chrome::FindBrowserWithWebContents( | 361 Browser* browser = chrome::FindBrowserWithWebContents( |
362 web_ui()->GetWebContents()); | 362 web_ui()->GetWebContents()); |
363 bool force_new_tab = false; | 363 bool force_new_tab = false; |
364 if (!browser) { | 364 if (!browser) { |
365 // Settings is not displayed in a browser window. Open a new window. | 365 // Settings is not displayed in a browser window. Open a new window. |
366 browser = | 366 browser = new Browser( |
367 new Browser(Browser::CreateParams(Browser::TYPE_TABBED, GetProfile())); | 367 Browser::CreateParams(Browser::TYPE_TABBED, GetProfile(), true)); |
368 force_new_tab = true; | 368 force_new_tab = true; |
369 } | 369 } |
370 | 370 |
371 // If the signin manager already has an authenticated username, this is a | 371 // If the signin manager already has an authenticated username, this is a |
372 // re-auth scenario, and we need to ensure that the user signs in with the | 372 // re-auth scenario, and we need to ensure that the user signs in with the |
373 // same email address. | 373 // same email address. |
374 GURL url; | 374 GURL url; |
375 if (SigninManagerFactory::GetForProfile( | 375 if (SigninManagerFactory::GetForProfile( |
376 browser->profile())->IsAuthenticated()) { | 376 browser->profile())->IsAuthenticated()) { |
377 UMA_HISTOGRAM_ENUMERATION("Signin.Reauth", | 377 UMA_HISTOGRAM_ENUMERATION("Signin.Reauth", |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 page, args); | 947 page, args); |
948 | 948 |
949 // Make sure the tab used for the Gaia sign in does not cover the settings | 949 // Make sure the tab used for the Gaia sign in does not cover the settings |
950 // tab. | 950 // tab. |
951 FocusUI(); | 951 FocusUI(); |
952 } | 952 } |
953 | 953 |
954 LoginUIService* SyncSetupHandler::GetLoginUIService() const { | 954 LoginUIService* SyncSetupHandler::GetLoginUIService() const { |
955 return LoginUIServiceFactory::GetForProfile(GetProfile()); | 955 return LoginUIServiceFactory::GetForProfile(GetProfile()); |
956 } | 956 } |
OLD | NEW |