OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/services/gcm/gcm_profile_service.h" | 5 #include "chrome/browser/services/gcm/gcm_profile_service.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 // When sign-in enforcement is not dropped, OnSignedOut will also clear all | 105 // When sign-in enforcement is not dropped, OnSignedOut will also clear all |
106 // the GCM data and a new GCM ID will be retrieved after the user signs in | 106 // the GCM data and a new GCM ID will be retrieved after the user signs in |
107 // again. Otherwise, the user sign-out will not affect the existing GCM | 107 // again. Otherwise, the user sign-out will not affect the existing GCM |
108 // data. | 108 // data. |
109 driver_->OnSignedOut(); | 109 driver_->OnSignedOut(); |
110 } | 110 } |
111 | 111 |
112 std::string GCMProfileService::IdentityObserver::SignedInUserName() const { | 112 std::string GCMProfileService::IdentityObserver::SignedInUserName() const { |
113 return driver_->IsStarted() ? account_id_ : std::string(); | 113 return driver_->IsStarted() ? account_id_ : std::string(); |
114 } | 114 } |
115 | |
Nicolas Zea
2014/11/06 21:43:17
Did you mean to remove this?
fgorski
2014/11/07 01:42:13
Done. Definitely an accident.
| |
116 void GCMProfileService::IdentityObserver::StartAccountTracker() { | 115 void GCMProfileService::IdentityObserver::StartAccountTracker() { |
117 if (gcm_account_tracker_) | 116 if (gcm_account_tracker_) |
118 return; | 117 return; |
119 | 118 |
120 scoped_ptr<gaia::AccountTracker> gaia_account_tracker( | 119 scoped_ptr<gaia::AccountTracker> gaia_account_tracker( |
121 new gaia::AccountTracker(identity_provider_.get(), | 120 new gaia::AccountTracker(identity_provider_.get(), |
122 profile_->GetRequestContext())); | 121 profile_->GetRequestContext())); |
123 | 122 |
124 gcm_account_tracker_.reset( | 123 gcm_account_tracker_.reset( |
125 new GCMAccountTracker(gaia_account_tracker.Pass(), driver_)); | 124 new GCMAccountTracker(gaia_account_tracker.Pass(), driver_)); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
208 | 207 |
209 void GCMProfileService::SetDriverForTesting(GCMDriver* driver) { | 208 void GCMProfileService::SetDriverForTesting(GCMDriver* driver) { |
210 driver_.reset(driver); | 209 driver_.reset(driver); |
211 #if !defined(OS_ANDROID) | 210 #if !defined(OS_ANDROID) |
212 if (identity_observer_) | 211 if (identity_observer_) |
213 identity_observer_.reset(new IdentityObserver(profile_, driver)); | 212 identity_observer_.reset(new IdentityObserver(profile_, driver)); |
214 #endif // !defined(OS_ANDROID) | 213 #endif // !defined(OS_ANDROID) |
215 } | 214 } |
216 | 215 |
217 } // namespace gcm | 216 } // namespace gcm |
OLD | NEW |