| 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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 if (!continue_url_.is_empty()) { | 592 if (!continue_url_.is_empty()) { |
| 593 // The observer deletes itself once it's done. | 593 // The observer deletes itself once it's done. |
| 594 DCHECK(!sub_page.empty()); | 594 DCHECK(!sub_page.empty()); |
| 595 new OneClickSigninSyncObserver(contents, continue_url_); | 595 new OneClickSigninSyncObserver(contents, continue_url_); |
| 596 } | 596 } |
| 597 | 597 |
| 598 GURL url = chrome::GetSettingsUrl(sub_page); | 598 GURL url = chrome::GetSettingsUrl(sub_page); |
| 599 content::OpenURLParams params(url, | 599 content::OpenURLParams params(url, |
| 600 content::Referrer(), | 600 content::Referrer(), |
| 601 CURRENT_TAB, | 601 CURRENT_TAB, |
| 602 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 602 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 603 false); | 603 false); |
| 604 contents->OpenURL(params); | 604 contents->OpenURL(params); |
| 605 | 605 |
| 606 // Activate the tab. | 606 // Activate the tab. |
| 607 Browser* browser = chrome::FindBrowserWithWebContents(contents); | 607 Browser* browser = chrome::FindBrowserWithWebContents(contents); |
| 608 int content_index = | 608 int content_index = |
| 609 browser->tab_strip_model()->GetIndexOfWebContents(contents); | 609 browser->tab_strip_model()->GetIndexOfWebContents(contents); |
| 610 browser->tab_strip_model()->ActivateTabAt(content_index, | 610 browser->tab_strip_model()->ActivateTabAt(content_index, |
| 611 false /* user_gesture */); | 611 false /* user_gesture */); |
| 612 } | 612 } |
| 613 | 613 |
| 614 void OneClickSigninSyncStarter::LoadContinueUrl() { | 614 void OneClickSigninSyncStarter::LoadContinueUrl() { |
| 615 web_contents()->GetController().LoadURL( | 615 web_contents()->GetController().LoadURL( |
| 616 continue_url_, | 616 continue_url_, |
| 617 content::Referrer(), | 617 content::Referrer(), |
| 618 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 618 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 619 std::string()); | 619 std::string()); |
| 620 } | 620 } |
| OLD | NEW |