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

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

Issue 398083002: Add "UninstallReason" parameter to ExtensionRegistryObserver::OnExtensionUninstalled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 23 matching lines...) Expand all
34 #include "ui/base/resource/resource_bundle.h" 34 #include "ui/base/resource/resource_bundle.h"
35 #include "ui/gfx/image/image_skia.h" 35 #include "ui/gfx/image/image_skia.h"
36 36
37 #if defined(OS_WIN) 37 #if defined(OS_WIN)
38 #include "ui/base/win/shell.h" 38 #include "ui/base/win/shell.h"
39 #endif 39 #endif
40 40
41 using base::UserMetricsAction; 41 using base::UserMetricsAction;
42 using content::BrowserThread; 42 using content::BrowserThread;
43 using extensions::Extension; 43 using extensions::Extension;
44 using extensions::UninstalledExtensionInfo;
44 using extensions::UnloadedExtensionInfo; 45 using extensions::UnloadedExtensionInfo;
45 using ui::ResourceBundle; 46 using ui::ResourceBundle;
46 47
47 typedef ThemeProperties Properties; 48 typedef ThemeProperties Properties;
48 49
49 // The default theme if we haven't installed a theme yet or if we've clicked 50 // The default theme if we haven't installed a theme yet or if we've clicked
50 // the "Use Classic" button. 51 // the "Use Classic" button.
51 const char* ThemeService::kDefaultThemeID = ""; 52 const char* ThemeService::kDefaultThemeID = "";
52 53
53 namespace { 54 namespace {
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 remove_list.push_back((*it)->id()); 366 remove_list.push_back((*it)->id());
366 } 367 }
367 } 368 }
368 } 369 }
369 // TODO: Garbage collect all unused themes. This method misses themes which 370 // TODO: Garbage collect all unused themes. This method misses themes which
370 // are installed but not loaded because they are blacklisted by a management 371 // are installed but not loaded because they are blacklisted by a management
371 // policy provider. 372 // policy provider.
372 373
373 for (size_t i = 0; i < remove_list.size(); ++i) { 374 for (size_t i = 0; i < remove_list.size(); ++i) {
374 service->UninstallExtension( 375 service->UninstallExtension(
375 remove_list[i], 376 remove_list[i], UninstalledExtensionInfo::REASON_ORPHANED_THEME, NULL);
376 ExtensionService::UNINSTALL_REASON_ORPHANED_THEME,
377 NULL);
378 } 377 }
379 } 378 }
380 379
381 void ThemeService::UseDefaultTheme() { 380 void ThemeService::UseDefaultTheme() {
382 if (ready_) 381 if (ready_)
383 content::RecordAction(UserMetricsAction("Themes_Reset")); 382 content::RecordAction(UserMetricsAction("Themes_Reset"));
384 if (IsSupervisedUser()) { 383 if (IsSupervisedUser()) {
385 SetSupervisedUserTheme(); 384 SetSupervisedUserTheme();
386 return; 385 return;
387 } 386 }
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 void ThemeService::OnInfobarDestroyed() { 603 void ThemeService::OnInfobarDestroyed() {
605 number_of_infobars_--; 604 number_of_infobars_--;
606 605
607 if (number_of_infobars_ == 0) 606 if (number_of_infobars_ == 0)
608 RemoveUnusedThemes(false); 607 RemoveUnusedThemes(false);
609 } 608 }
610 609
611 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { 610 ThemeSyncableService* ThemeService::GetThemeSyncableService() const {
612 return theme_syncable_service_.get(); 611 return theme_syncable_service_.get();
613 } 612 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698