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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 | 10 |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 void OneClickSigninSyncStarter::FinishProfileSyncServiceSetup() { | 501 void OneClickSigninSyncStarter::FinishProfileSyncServiceSetup() { |
502 ProfileSyncService* service = | 502 ProfileSyncService* service = |
503 ProfileSyncServiceFactory::GetForProfile(profile_); | 503 ProfileSyncServiceFactory::GetForProfile(profile_); |
504 if (service) | 504 if (service) |
505 service->SetSetupInProgress(false); | 505 service->SetSetupInProgress(false); |
506 } | 506 } |
507 | 507 |
508 void OneClickSigninSyncStarter::ShowSettingsPageInWebContents( | 508 void OneClickSigninSyncStarter::ShowSettingsPageInWebContents( |
509 content::WebContents* contents, | 509 content::WebContents* contents, |
510 const std::string& sub_page) { | 510 const std::string& sub_page) { |
511 std::string url = std::string(chrome::kChromeUISettingsURL) + sub_page; | 511 GURL url = chrome::GetSettingsUrl(sub_page); |
512 content::OpenURLParams params(GURL(url), | 512 content::OpenURLParams params(url, |
513 content::Referrer(), | 513 content::Referrer(), |
514 CURRENT_TAB, | 514 CURRENT_TAB, |
515 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 515 content::PAGE_TRANSITION_AUTO_TOPLEVEL, |
516 false); | 516 false); |
517 contents->OpenURL(params); | 517 contents->OpenURL(params); |
518 | 518 |
519 // Activate the tab. | 519 // Activate the tab. |
520 Browser* browser = chrome::FindBrowserWithWebContents(contents); | 520 Browser* browser = chrome::FindBrowserWithWebContents(contents); |
521 int content_index = | 521 int content_index = |
522 browser->tab_strip_model()->GetIndexOfWebContents(contents); | 522 browser->tab_strip_model()->GetIndexOfWebContents(contents); |
523 browser->tab_strip_model()->ActivateTabAt(content_index, | 523 browser->tab_strip_model()->ActivateTabAt(content_index, |
524 false /* user_gesture */); | 524 false /* user_gesture */); |
525 } | 525 } |
OLD | NEW |