Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 const bool kRemoteInstall = false; |
| 239 const bool kInstalledByCustodian = false; | |
| 239 if (!extensions_service->pending_extension_manager()->AddFromSync( | 240 if (!extensions_service->pending_extension_manager()->AddFromSync( |
| 240 id, update_url, &IsTheme, kInstallSilently, kRemoteInstall)) { | 241 id, |
| 242 update_url, | |
| 243 &IsTheme, | |
| 244 kInstallSilently, | |
| 245 kRemoteInstall, | |
|
not at google - send to devlin
2014/07/02 16:18:56
(this seems like another candidate for using Insta
| |
| 246 kInstalledByCustodian)) { | |
| 241 LOG(WARNING) << "Could not add pending extension for " << id; | 247 LOG(WARNING) << "Could not add pending extension for " << id; |
| 242 return; | 248 return; |
| 243 } | 249 } |
| 244 extensions_service->CheckForUpdatesSoon(); | 250 extensions_service->CheckForUpdatesSoon(); |
| 245 } | 251 } |
| 246 } else if (theme_specifics.use_system_theme_by_default()) { | 252 } else if (theme_specifics.use_system_theme_by_default()) { |
| 247 DVLOG(1) << "Switch to use system theme"; | 253 DVLOG(1) << "Switch to use system theme"; |
| 248 theme_service_->UseSystemTheme(); | 254 theme_service_->UseSystemTheme(); |
| 249 } else { | 255 } else { |
| 250 DVLOG(1) << "Switch to use default theme"; | 256 DVLOG(1) << "Switch to use default theme"; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 syncer::SyncChange(FROM_HERE, change_type, | 342 syncer::SyncChange(FROM_HERE, change_type, |
| 337 syncer::SyncData::CreateLocalData( | 343 syncer::SyncData::CreateLocalData( |
| 338 kCurrentThemeClientTag, kCurrentThemeNodeTitle, | 344 kCurrentThemeClientTag, kCurrentThemeNodeTitle, |
| 339 entity_specifics))); | 345 entity_specifics))); |
| 340 | 346 |
| 341 DVLOG(1) << "Update theme specifics from current theme: " | 347 DVLOG(1) << "Update theme specifics from current theme: " |
| 342 << changes.back().ToString(); | 348 << changes.back().ToString(); |
| 343 | 349 |
| 344 return sync_processor_->ProcessSyncChanges(FROM_HERE, changes); | 350 return sync_processor_->ProcessSyncChanges(FROM_HERE, changes); |
| 345 } | 351 } |
| OLD | NEW |