| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 FROM_HERE, | 73 FROM_HERE, |
| 74 base::Bind(&CloseTab, base::Unretained(web_contents()))); | 74 base::Bind(&CloseTab, base::Unretained(web_contents()))); |
| 75 } else { | 75 } else { |
| 76 if (sync_service->FirstSetupInProgress()) { | 76 if (sync_service->FirstSetupInProgress()) { |
| 77 // Sync setup has not completed yet. Wait for it to complete. | 77 // Sync setup has not completed yet. Wait for it to complete. |
| 78 return; | 78 return; |
| 79 } | 79 } |
| 80 | 80 |
| 81 if (sync_service->SyncActive() && | 81 if (sync_service->SyncActive() && |
| 82 signin::GetSourceForPromoURL(continue_url_) | 82 signin::GetSourceForPromoURL(continue_url_) |
| 83 != signin::SOURCE_SETTINGS) { | 83 != signin_metrics::SOURCE_SETTINGS) { |
| 84 // TODO(isherman): Having multiple settings pages open can cause issues | 84 // TODO(isherman): Having multiple settings pages open can cause issues |
| 85 // redirecting after Sync is set up: http://crbug.com/355885 | 85 // redirecting after Sync is set up: http://crbug.com/355885 |
| 86 LoadContinueUrl(); | 86 LoadContinueUrl(); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 | 89 |
| 90 sync_service->RemoveObserver(this); | 90 sync_service->RemoveObserver(this); |
| 91 delete this; | 91 delete this; |
| 92 } | 92 } |
| 93 | 93 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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 |