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

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

Issue 284103002: Replace "external_install" boolean parameter with explicit enumeration in ExtensionUninstall method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address issue exposed by failing unit test. Created 6 years, 5 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
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 if (!prefs->IsExtensionDisabled(extension->id()) || 359 if (!prefs->IsExtensionDisabled(extension->id()) ||
360 disable_reason == Extension::DISABLE_USER_ACTION) { 360 disable_reason == Extension::DISABLE_USER_ACTION) {
361 remove_list.push_back((*it)->id()); 361 remove_list.push_back((*it)->id());
362 } 362 }
363 } 363 }
364 } 364 }
365 // TODO: Garbage collect all unused themes. This method misses themes which 365 // TODO: Garbage collect all unused themes. This method misses themes which
366 // are installed but not loaded because they are blacklisted by a management 366 // are installed but not loaded because they are blacklisted by a management
367 // policy provider. 367 // policy provider.
368 368
369 for (size_t i = 0; i < remove_list.size(); ++i) 369 for (size_t i = 0; i < remove_list.size(); ++i) {
370 service->UninstallExtension(remove_list[i], false, NULL); 370 service->UninstallExtension(
371 remove_list[i],
372 ExtensionService::UNINSTALL_REASON_ORPHANED_THEME,
373 NULL);
374 }
371 } 375 }
372 376
373 void ThemeService::UseDefaultTheme() { 377 void ThemeService::UseDefaultTheme() {
374 if (ready_) 378 if (ready_)
375 content::RecordAction(UserMetricsAction("Themes_Reset")); 379 content::RecordAction(UserMetricsAction("Themes_Reset"));
376 if (IsSupervisedUser()) { 380 if (IsSupervisedUser()) {
377 SetSupervisedUserTheme(); 381 SetSupervisedUserTheme();
378 return; 382 return;
379 } 383 }
380 ClearAllThemeData(); 384 ClearAllThemeData();
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 void ThemeService::OnInfobarDestroyed() { 600 void ThemeService::OnInfobarDestroyed() {
597 number_of_infobars_--; 601 number_of_infobars_--;
598 602
599 if (number_of_infobars_ == 0) 603 if (number_of_infobars_ == 0)
600 RemoveUnusedThemes(false); 604 RemoveUnusedThemes(false);
601 } 605 }
602 606
603 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { 607 ThemeSyncableService* ThemeService::GetThemeSyncableService() const {
604 return theme_syncable_service_.get(); 608 return theme_syncable_service_.get();
605 } 609 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/sync_extension_helper.cc ('k') | chrome/browser/themes/theme_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698