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

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: 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
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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 if (!prefs->IsExtensionDisabled(extension->id()) || 360 if (!prefs->IsExtensionDisabled(extension->id()) ||
361 disable_reason == Extension::DISABLE_USER_ACTION) { 361 disable_reason == Extension::DISABLE_USER_ACTION) {
362 remove_list.push_back((*it)->id()); 362 remove_list.push_back((*it)->id());
363 } 363 }
364 } 364 }
365 } 365 }
366 // TODO: Garbage collect all unused themes. This method misses themes which 366 // TODO: Garbage collect all unused themes. This method misses themes which
367 // are installed but not loaded because they are blacklisted by a management 367 // are installed but not loaded because they are blacklisted by a management
368 // policy provider. 368 // policy provider.
369 369
370 for (size_t i = 0; i < remove_list.size(); ++i) 370 for (size_t i = 0; i < remove_list.size(); ++i) {
371 service->UninstallExtension(remove_list[i], false, NULL); 371 service->UninstallExtension(
372 remove_list[i], ExtensionService::kUninstallReasonOrphanedTheme, NULL);
373 }
372 } 374 }
373 375
374 void ThemeService::UseDefaultTheme() { 376 void ThemeService::UseDefaultTheme() {
375 if (ready_) 377 if (ready_)
376 content::RecordAction(UserMetricsAction("Themes_Reset")); 378 content::RecordAction(UserMetricsAction("Themes_Reset"));
377 if (IsManagedUser()) { 379 if (IsManagedUser()) {
378 SetManagedUserTheme(); 380 SetManagedUserTheme();
379 return; 381 return;
380 } 382 }
381 ClearAllThemeData(); 383 ClearAllThemeData();
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 void ThemeService::OnInfobarDestroyed() { 599 void ThemeService::OnInfobarDestroyed() {
598 number_of_infobars_--; 600 number_of_infobars_--;
599 601
600 if (number_of_infobars_ == 0) 602 if (number_of_infobars_ == 0)
601 RemoveUnusedThemes(false); 603 RemoveUnusedThemes(false);
602 } 604 }
603 605
604 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { 606 ThemeSyncableService* ThemeService::GetThemeSyncableService() const {
605 return theme_syncable_service_.get(); 607 return theme_syncable_service_.get();
606 } 608 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698