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

Side by Side Diff: chrome/browser/ui/sync/one_click_signin_sync_starter.cc

Issue 2685333005: ash: fix regression where ctrl+n put new window on wrong desktop (Closed)
Patch Set: Rebase to ToT Created 3 years, 10 months 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
OLDNEW
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/sync/one_click_signin_sync_starter.h" 5 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 558
559 // static 559 // static
560 Browser* OneClickSigninSyncStarter::EnsureBrowser(Browser* browser, 560 Browser* OneClickSigninSyncStarter::EnsureBrowser(Browser* browser,
561 Profile* profile) { 561 Profile* profile) {
562 if (!browser) { 562 if (!browser) {
563 // The user just created a new profile or has closed the browser that 563 // The user just created a new profile or has closed the browser that
564 // we used previously. Grab the most recently active browser or else 564 // we used previously. Grab the most recently active browser or else
565 // create a new one. 565 // create a new one.
566 browser = chrome::FindLastActiveWithProfile(profile); 566 browser = chrome::FindLastActiveWithProfile(profile);
567 if (!browser) { 567 if (!browser) {
568 browser = new Browser(Browser::CreateParams(profile)); 568 browser = new Browser(Browser::CreateParams(profile, true));
569 chrome::AddTabAt(browser, GURL(), -1, true); 569 chrome::AddTabAt(browser, GURL(), -1, true);
570 } 570 }
571 browser->window()->Show(); 571 browser->window()->Show();
572 } 572 }
573 return browser; 573 return browser;
574 } 574 }
575 575
576 void OneClickSigninSyncStarter::ShowSettingsPage(bool configure_sync) { 576 void OneClickSigninSyncStarter::ShowSettingsPage(bool configure_sync) {
577 // Give the user a chance to configure things. We don't clear the 577 // Give the user a chance to configure things. We don't clear the
578 // ProfileSyncService::setup_in_progress flag because we don't want sync 578 // ProfileSyncService::setup_in_progress flag because we don't want sync
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 false /* user_gesture */); 667 false /* user_gesture */);
668 } 668 }
669 669
670 void OneClickSigninSyncStarter::LoadContinueUrl() { 670 void OneClickSigninSyncStarter::LoadContinueUrl() {
671 web_contents()->GetController().LoadURL( 671 web_contents()->GetController().LoadURL(
672 continue_url_, 672 continue_url_,
673 content::Referrer(), 673 content::Referrer(),
674 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, 674 ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
675 std::string()); 675 std::string());
676 } 676 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698