| 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.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 void OneClickSigninSyncStarter::ShowSettingsPageInWebContents( | 620 void OneClickSigninSyncStarter::ShowSettingsPageInWebContents( |
| 621 content::WebContents* contents, | 621 content::WebContents* contents, |
| 622 const std::string& sub_page) { | 622 const std::string& sub_page) { |
| 623 if (!continue_url_.is_empty()) { | 623 if (!continue_url_.is_empty()) { |
| 624 // The observer deletes itself once it's done. | 624 // The observer deletes itself once it's done. |
| 625 DCHECK(!sub_page.empty()); | 625 DCHECK(!sub_page.empty()); |
| 626 new OneClickSigninSyncObserver(contents, continue_url_); | 626 new OneClickSigninSyncObserver(contents, continue_url_); |
| 627 } | 627 } |
| 628 | 628 |
| 629 GURL url = chrome::GetSettingsUrl(sub_page); | 629 GURL url = chrome::GetSettingsUrl(sub_page); |
| 630 content::OpenURLParams params(url, | 630 content::OpenURLParams params(url, content::Referrer(), |
| 631 content::Referrer(), | 631 WindowOpenDisposition::CURRENT_TAB, |
| 632 CURRENT_TAB, | 632 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false); |
| 633 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | |
| 634 false); | |
| 635 contents->OpenURL(params); | 633 contents->OpenURL(params); |
| 636 | 634 |
| 637 // Activate the tab. | 635 // Activate the tab. |
| 638 Browser* browser = chrome::FindBrowserWithWebContents(contents); | 636 Browser* browser = chrome::FindBrowserWithWebContents(contents); |
| 639 int content_index = | 637 int content_index = |
| 640 browser->tab_strip_model()->GetIndexOfWebContents(contents); | 638 browser->tab_strip_model()->GetIndexOfWebContents(contents); |
| 641 browser->tab_strip_model()->ActivateTabAt(content_index, | 639 browser->tab_strip_model()->ActivateTabAt(content_index, |
| 642 false /* user_gesture */); | 640 false /* user_gesture */); |
| 643 } | 641 } |
| 644 | 642 |
| 645 void OneClickSigninSyncStarter::LoadContinueUrl() { | 643 void OneClickSigninSyncStarter::LoadContinueUrl() { |
| 646 web_contents()->GetController().LoadURL( | 644 web_contents()->GetController().LoadURL( |
| 647 continue_url_, | 645 continue_url_, |
| 648 content::Referrer(), | 646 content::Referrer(), |
| 649 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 647 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 650 std::string()); | 648 std::string()); |
| 651 } | 649 } |
| OLD | NEW |