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

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

Issue 695133005: Temporarily disable extensions and sync while a profile is locked - Profiles Approach (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Many more unit tests. Change screenLockAPI permissions. Themes fix. Created 6 years, 1 month 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
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_service.h" 5 #include "chrome/browser/themes/theme_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 293 }
294 case extensions::NOTIFICATION_EXTENSION_ENABLED: { 294 case extensions::NOTIFICATION_EXTENSION_ENABLED: {
295 const Extension* extension = Details<const Extension>(details).ptr(); 295 const Extension* extension = Details<const Extension>(details).ptr();
296 if (extension->is_theme()) 296 if (extension->is_theme())
297 SetTheme(extension); 297 SetTheme(extension);
298 break; 298 break;
299 } 299 }
300 case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: { 300 case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
301 Details<const UnloadedExtensionInfo> unloaded_details(details); 301 Details<const UnloadedExtensionInfo> unloaded_details(details);
302 if (unloaded_details->reason != UnloadedExtensionInfo::REASON_UPDATE && 302 if (unloaded_details->reason != UnloadedExtensionInfo::REASON_UPDATE &&
303 unloaded_details->reason != UnloadedExtensionInfo::REASON_LOCK_ALL &&
Mike Lerman 2014/11/21 17:00:13 We don't want to change the profile's theme if we'
303 unloaded_details->extension->is_theme() && 304 unloaded_details->extension->is_theme() &&
304 unloaded_details->extension->id() == GetThemeID()) { 305 unloaded_details->extension->id() == GetThemeID()) {
305 UseDefaultTheme(); 306 UseDefaultTheme();
306 } 307 }
307 break; 308 break;
308 } 309 }
309 } 310 }
310 } 311 }
311 312
312 void ThemeService::SetTheme(const Extension* extension) { 313 void ThemeService::SetTheme(const Extension* extension) {
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 void ThemeService::OnInfobarDestroyed() { 634 void ThemeService::OnInfobarDestroyed() {
634 number_of_infobars_--; 635 number_of_infobars_--;
635 636
636 if (number_of_infobars_ == 0) 637 if (number_of_infobars_ == 0)
637 RemoveUnusedThemes(false); 638 RemoveUnusedThemes(false);
638 } 639 }
639 640
640 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { 641 ThemeSyncableService* ThemeService::GetThemeSyncableService() const {
641 return theme_syncable_service_.get(); 642 return theme_syncable_service_.get();
642 } 643 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_window.cc ('k') | chrome/common/extensions/api/_permission_features.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698