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

Side by Side Diff: chrome/browser/sync/profile_sync_service.cc

Issue 165993005: [GCM] Make sure GCM checkout logic is invoked when the profile is signed out (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 6 years, 9 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/sync/profile_sync_service.h" 5 #include "chrome/browser/sync/profile_sync_service.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 return; 1075 return;
1076 1076
1077 current_experiments_ = experiments; 1077 current_experiments_ = experiments;
1078 1078
1079 // Handle preference-backed experiments first. 1079 // Handle preference-backed experiments first.
1080 if (experiments.gcm_channel_state != syncer::Experiments::UNSET) { 1080 if (experiments.gcm_channel_state != syncer::Experiments::UNSET) {
1081 profile()->GetPrefs()->SetBoolean(prefs::kGCMChannelEnabled, 1081 profile()->GetPrefs()->SetBoolean(prefs::kGCMChannelEnabled,
1082 experiments.gcm_channel_state == 1082 experiments.gcm_channel_state ==
1083 syncer::Experiments::ENABLED); 1083 syncer::Experiments::ENABLED);
1084 gcm::GCMProfileServiceFactory::GetForProfile(profile()); 1084 gcm::GCMProfileServiceFactory::GetForProfile(profile());
1085 } else {
1086 profile()->GetPrefs()->ClearPref(prefs::kGCMChannelEnabled);
1085 } 1087 }
1086 1088
1087 if (experiments.enhanced_bookmarks_enabled) { 1089 if (experiments.enhanced_bookmarks_enabled) {
1088 profile_->GetPrefs()->SetBoolean(prefs::kEnhancedBookmarksExperimentEnabled, 1090 profile_->GetPrefs()->SetBoolean(prefs::kEnhancedBookmarksExperimentEnabled,
1089 true); 1091 true);
1090 profile_->GetPrefs()->SetString(prefs::kEnhancedBookmarksExtensionId, 1092 profile_->GetPrefs()->SetString(prefs::kEnhancedBookmarksExtensionId,
1091 experiments.enhanced_bookmarks_ext_id); 1093 experiments.enhanced_bookmarks_ext_id);
1092 } 1094 }
1093 1095
1094 // If this is a first time sync for a client, this will be called before 1096 // If this is a first time sync for a client, this will be called before
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 status.last_get_token_error = last_get_token_error_; 2243 status.last_get_token_error = last_get_token_error_;
2242 if (request_access_token_retry_timer_.IsRunning()) 2244 if (request_access_token_retry_timer_.IsRunning())
2243 status.next_token_request_time = next_token_request_time_; 2245 status.next_token_request_time = next_token_request_time_;
2244 return status; 2246 return status;
2245 } 2247 }
2246 2248
2247 void ProfileSyncService::OverrideNetworkResourcesForTest( 2249 void ProfileSyncService::OverrideNetworkResourcesForTest(
2248 scoped_ptr<syncer::NetworkResources> network_resources) { 2250 scoped_ptr<syncer::NetworkResources> network_resources) {
2249 network_resources_ = network_resources.Pass(); 2251 network_resources_ = network_resources.Pass();
2250 } 2252 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698