Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1069)

Side by Side Diff: chrome/browser/services/gcm/gcm_profile_service.cc

Issue 293053014: Retrieve chrome build info in GCMProfileService, instead of GCMDriver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/services/gcm/gcm_driver.h" 12 #include "chrome/browser/services/gcm/gcm_driver.h"
13 #include "chrome/browser/services/gcm/gcm_utils.h"
13 #include "chrome/browser/signin/profile_identity_provider.h" 14 #include "chrome/browser/signin/profile_identity_provider.h"
14 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 15 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
15 #include "chrome/browser/signin/signin_manager_factory.h" 16 #include "chrome/browser/signin/signin_manager_factory.h"
16 #include "chrome/common/chrome_constants.h" 17 #include "chrome/common/chrome_constants.h"
17 #include "chrome/common/chrome_version_info.h" 18 #include "chrome/common/chrome_version_info.h"
18 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
19 #include "components/gcm_driver/gcm_client_factory.h" 20 #include "components/gcm_driver/gcm_client_factory.h"
20 #include "components/pref_registry/pref_registry_syncable.h" 21 #include "components/pref_registry/pref_registry_syncable.h"
21 #include "components/signin/core/browser/signin_manager.h" 22 #include "components/signin/core/browser/signin_manager.h"
22 #include "content/public/browser/browser_thread.h" 23 #include "content/public/browser/browser_thread.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 #else 95 #else
95 LoginUIService* login_ui_service = 96 LoginUIService* login_ui_service =
96 LoginUIServiceFactory::GetForProfile(profile_); 97 LoginUIServiceFactory::GetForProfile(profile_);
97 #endif 98 #endif
98 driver_.reset(new GCMDriver( 99 driver_.reset(new GCMDriver(
99 gcm_client_factory.Pass(), 100 gcm_client_factory.Pass(),
100 scoped_ptr<IdentityProvider>(new ProfileIdentityProvider( 101 scoped_ptr<IdentityProvider>(new ProfileIdentityProvider(
101 SigninManagerFactory::GetForProfile(profile_), 102 SigninManagerFactory::GetForProfile(profile_),
102 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_), 103 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_),
103 login_ui_service)), 104 login_ui_service)),
105 GetChromeBuildInfo(),
104 profile_->GetPath().Append(chrome::kGCMStoreDirname), 106 profile_->GetPath().Append(chrome::kGCMStoreDirname),
105 profile_->GetRequestContext(), 107 profile_->GetRequestContext(),
106 content::BrowserThread::GetMessageLoopProxyForThread( 108 content::BrowserThread::GetMessageLoopProxyForThread(
107 content::BrowserThread::UI), 109 content::BrowserThread::UI),
108 content::BrowserThread::GetMessageLoopProxyForThread( 110 content::BrowserThread::GetMessageLoopProxyForThread(
109 content::BrowserThread::IO), 111 content::BrowserThread::IO),
110 blocking_task_runner)); 112 blocking_task_runner));
111 } 113 }
112 114
113 GCMProfileService::GCMProfileService() : profile_(NULL) { 115 GCMProfileService::GCMProfileService() : profile_(NULL) {
(...skipping 25 matching lines...) Expand all
139 driver_->Shutdown(); 141 driver_->Shutdown();
140 driver_.reset(); 142 driver_.reset();
141 } 143 }
142 } 144 }
143 145
144 void GCMProfileService::SetDriverForTesting(GCMDriver* driver) { 146 void GCMProfileService::SetDriverForTesting(GCMDriver* driver) {
145 driver_.reset(driver); 147 driver_.reset(driver);
146 } 148 }
147 149
148 } // namespace gcm 150 } // namespace gcm
OLDNEW
« no previous file with comments | « chrome/browser/services/gcm/gcm_driver_unittest.cc ('k') | chrome/browser/services/gcm/gcm_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698