| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_observer.h" | 5 #include "chrome/browser/ui/sync/one_click_signin_sync_observer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/signin/signin_promo.h" | 10 #include "chrome/browser/signin/signin_promo.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 88 } |
| 89 | 89 |
| 90 sync_service->RemoveObserver(this); | 90 sync_service->RemoveObserver(this); |
| 91 delete this; | 91 delete this; |
| 92 } | 92 } |
| 93 | 93 |
| 94 void OneClickSigninSyncObserver::LoadContinueUrl() { | 94 void OneClickSigninSyncObserver::LoadContinueUrl() { |
| 95 web_contents()->GetController().LoadURL( | 95 web_contents()->GetController().LoadURL( |
| 96 continue_url_, | 96 continue_url_, |
| 97 content::Referrer(), | 97 content::Referrer(), |
| 98 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 98 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 99 std::string()); | 99 std::string()); |
| 100 } | 100 } |
| 101 | 101 |
| 102 ProfileSyncService* OneClickSigninSyncObserver::GetSyncService( | 102 ProfileSyncService* OneClickSigninSyncObserver::GetSyncService( |
| 103 content::WebContents* web_contents) { | 103 content::WebContents* web_contents) { |
| 104 Profile* profile = | 104 Profile* profile = |
| 105 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 105 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 106 return ProfileSyncServiceFactory::GetForProfile(profile); | 106 return ProfileSyncServiceFactory::GetForProfile(profile); |
| 107 } | 107 } |
| 108 | 108 |
| 109 // static | 109 // static |
| 110 void OneClickSigninSyncObserver::DeleteObserver( | 110 void OneClickSigninSyncObserver::DeleteObserver( |
| 111 base::WeakPtr<OneClickSigninSyncObserver> observer) { | 111 base::WeakPtr<OneClickSigninSyncObserver> observer) { |
| 112 if (observer) | 112 if (observer) |
| 113 delete observer.get(); | 113 delete observer.get(); |
| 114 } | 114 } |
| OLD | NEW |