| 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_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 Loading... |
| 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( | 370 service->UninstallExtension(remove_list[i], false, NULL); |
| 371 remove_list[i], | |
| 372 ExtensionService::UNINSTALL_REASON_ORPHANED_THEME, | |
| 373 NULL); | |
| 374 } | |
| 375 } | 371 } |
| 376 | 372 |
| 377 void ThemeService::UseDefaultTheme() { | 373 void ThemeService::UseDefaultTheme() { |
| 378 if (ready_) | 374 if (ready_) |
| 379 content::RecordAction(UserMetricsAction("Themes_Reset")); | 375 content::RecordAction(UserMetricsAction("Themes_Reset")); |
| 380 if (IsSupervisedUser()) { | 376 if (IsSupervisedUser()) { |
| 381 SetSupervisedUserTheme(); | 377 SetSupervisedUserTheme(); |
| 382 return; | 378 return; |
| 383 } | 379 } |
| 384 ClearAllThemeData(); | 380 ClearAllThemeData(); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 void ThemeService::OnInfobarDestroyed() { | 596 void ThemeService::OnInfobarDestroyed() { |
| 601 number_of_infobars_--; | 597 number_of_infobars_--; |
| 602 | 598 |
| 603 if (number_of_infobars_ == 0) | 599 if (number_of_infobars_ == 0) |
| 604 RemoveUnusedThemes(false); | 600 RemoveUnusedThemes(false); |
| 605 } | 601 } |
| 606 | 602 |
| 607 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { | 603 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { |
| 608 return theme_syncable_service_.get(); | 604 return theme_syncable_service_.get(); |
| 609 } | 605 } |
| OLD | NEW |