| 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/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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |