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 29 matching lines...) Expand all Loading... |
40 | 40 |
41 #if !defined(OS_ANDROID) | 41 #if !defined(OS_ANDROID) |
42 // Identity observer only has actual work to do when the user is actually signed | 42 // Identity observer only has actual work to do when the user is actually signed |
43 // in. It ensures that account tracker is taking | 43 // in. It ensures that account tracker is taking |
44 class GCMProfileService::IdentityObserver : public IdentityProvider::Observer { | 44 class GCMProfileService::IdentityObserver : public IdentityProvider::Observer { |
45 public: | 45 public: |
46 IdentityObserver(Profile* profile, GCMDriver* driver); | 46 IdentityObserver(Profile* profile, GCMDriver* driver); |
47 virtual ~IdentityObserver(); | 47 virtual ~IdentityObserver(); |
48 | 48 |
49 // IdentityProvider::Observer: | 49 // IdentityProvider::Observer: |
50 virtual void OnActiveAccountLogin() OVERRIDE; | 50 virtual void OnActiveAccountLogin() override; |
51 virtual void OnActiveAccountLogout() OVERRIDE; | 51 virtual void OnActiveAccountLogout() override; |
52 | 52 |
53 std::string SignedInUserName() const; | 53 std::string SignedInUserName() const; |
54 | 54 |
55 // Called to inform IdentityObserver that a list of accounts was updated. | 55 // Called to inform IdentityObserver that a list of accounts was updated. |
56 // |account_tokens| is a list of email addresses, account IDs and OAuth2 | 56 // |account_tokens| is a list of email addresses, account IDs and OAuth2 |
57 // access tokens. | 57 // access tokens. |
58 void AccountsUpdated( | 58 void AccountsUpdated( |
59 const std::vector<GCMClient::AccountTokenInfo>& account_tokens); | 59 const std::vector<GCMClient::AccountTokenInfo>& account_tokens); |
60 | 60 |
61 private: | 61 private: |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 return identity_observer_ ? identity_observer_->SignedInUserName() | 230 return identity_observer_ ? identity_observer_->SignedInUserName() |
231 : std::string(); | 231 : std::string(); |
232 #endif // defined(OS_ANDROID) | 232 #endif // defined(OS_ANDROID) |
233 } | 233 } |
234 | 234 |
235 void GCMProfileService::SetDriverForTesting(GCMDriver* driver) { | 235 void GCMProfileService::SetDriverForTesting(GCMDriver* driver) { |
236 driver_.reset(driver); | 236 driver_.reset(driver); |
237 } | 237 } |
238 | 238 |
239 } // namespace gcm | 239 } // namespace gcm |
OLD | NEW |