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 "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 if (!browser) { | 497 if (!browser) { |
498 // The user just created a new profile or has closed the browser that | 498 // The user just created a new profile or has closed the browser that |
499 // we used previously. Grab the most recently active browser or else | 499 // we used previously. Grab the most recently active browser or else |
500 // create a new one. | 500 // create a new one. |
501 browser = chrome::FindLastActiveWithProfile(profile, desktop_type); | 501 browser = chrome::FindLastActiveWithProfile(profile, desktop_type); |
502 if (!browser) { | 502 if (!browser) { |
503 browser = new Browser(Browser::CreateParams(profile, | 503 browser = new Browser(Browser::CreateParams(profile, |
504 desktop_type)); | 504 desktop_type)); |
505 chrome::AddTabAt(browser, GURL(), -1, true); | 505 chrome::AddTabAt(browser, GURL(), -1, true); |
506 } | 506 } |
507 browser->window()->Show(); | 507 browser->window()->Show(true /* user_gesture */); |
508 } | 508 } |
509 return browser; | 509 return browser; |
510 } | 510 } |
511 | 511 |
512 void OneClickSigninSyncStarter::ShowSettingsPage(bool configure_sync) { | 512 void OneClickSigninSyncStarter::ShowSettingsPage(bool configure_sync) { |
513 // Give the user a chance to configure things. We don't clear the | 513 // Give the user a chance to configure things. We don't clear the |
514 // ProfileSyncService::setup_in_progress flag because we don't want sync | 514 // ProfileSyncService::setup_in_progress flag because we don't want sync |
515 // to start up until after the configure UI is displayed (the configure UI | 515 // to start up until after the configure UI is displayed (the configure UI |
516 // will clear the flag when the user is done setting up sync). | 516 // will clear the flag when the user is done setting up sync). |
517 ProfileSyncService* profile_sync_service = GetProfileSyncService(); | 517 ProfileSyncService* profile_sync_service = GetProfileSyncService(); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 false /* user_gesture */); | 606 false /* user_gesture */); |
607 } | 607 } |
608 | 608 |
609 void OneClickSigninSyncStarter::LoadContinueUrl() { | 609 void OneClickSigninSyncStarter::LoadContinueUrl() { |
610 web_contents()->GetController().LoadURL( | 610 web_contents()->GetController().LoadURL( |
611 continue_url_, | 611 continue_url_, |
612 content::Referrer(), | 612 content::Referrer(), |
613 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 613 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
614 std::string()); | 614 std::string()); |
615 } | 615 } |
OLD | NEW |