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

Side by Side Diff: chrome/browser/themes/theme_syncable_service.cc

Issue 264763002: Support remote installation of extensions and apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: histogram owner 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) 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/themes/theme_syncable_service.h" 5 #include "chrome/browser/themes/theme_syncable_service.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/themes/theme_service.h" 10 #include "chrome/browser/themes/theme_service.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 return; 228 return;
229 } 229 }
230 // An enabled theme extension with the given id was found, so 230 // An enabled theme extension with the given id was found, so
231 // just set the current theme to it. 231 // just set the current theme to it.
232 theme_service_->SetTheme(extension); 232 theme_service_->SetTheme(extension);
233 } else { 233 } else {
234 // No extension with this id exists -- we must install it; we do 234 // No extension with this id exists -- we must install it; we do
235 // so by adding it as a pending extension and then triggering an 235 // so by adding it as a pending extension and then triggering an
236 // auto-update cycle. 236 // auto-update cycle.
237 const bool kInstallSilently = true; 237 const bool kInstallSilently = true;
238 const bool kRemoteInstall = false;
238 if (!extensions_service->pending_extension_manager()->AddFromSync( 239 if (!extensions_service->pending_extension_manager()->AddFromSync(
239 id, update_url, &IsTheme, kInstallSilently)) { 240 id, update_url, &IsTheme, kInstallSilently, kRemoteInstall)) {
240 LOG(WARNING) << "Could not add pending extension for " << id; 241 LOG(WARNING) << "Could not add pending extension for " << id;
241 return; 242 return;
242 } 243 }
243 extensions_service->CheckForUpdatesSoon(); 244 extensions_service->CheckForUpdatesSoon();
244 } 245 }
245 } else if (theme_specifics.use_system_theme_by_default()) { 246 } else if (theme_specifics.use_system_theme_by_default()) {
246 DVLOG(1) << "Switch to use system theme"; 247 DVLOG(1) << "Switch to use system theme";
247 theme_service_->UseSystemTheme(); 248 theme_service_->UseSystemTheme();
248 } else { 249 } else {
249 DVLOG(1) << "Switch to use default theme"; 250 DVLOG(1) << "Switch to use default theme";
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 syncer::SyncChange(FROM_HERE, change_type, 336 syncer::SyncChange(FROM_HERE, change_type,
336 syncer::SyncData::CreateLocalData( 337 syncer::SyncData::CreateLocalData(
337 kCurrentThemeClientTag, kCurrentThemeNodeTitle, 338 kCurrentThemeClientTag, kCurrentThemeNodeTitle,
338 entity_specifics))); 339 entity_specifics)));
339 340
340 DVLOG(1) << "Update theme specifics from current theme: " 341 DVLOG(1) << "Update theme specifics from current theme: "
341 << changes.back().ToString(); 342 << changes.back().ToString();
342 343
343 return sync_processor_->ProcessSyncChanges(FROM_HERE, changes); 344 return sync_processor_->ProcessSyncChanges(FROM_HERE, changes);
344 } 345 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/two_client_apps_sync_test.cc ('k') | extensions/browser/extension_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698