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

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

Issue 13584007: Remove unused themes on clicking the reset theme button (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 3 Created 7 years, 8 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
« no previous file with comments | « chrome/browser/extensions/extension_install_ui_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 return ThemeProperties::GetDefaultTint(id); 298 return ThemeProperties::GetDefaultTint(id);
299 } 299 }
300 300
301 void ThemeService::ClearAllThemeData() { 301 void ThemeService::ClearAllThemeData() {
302 // Clear our image cache. 302 // Clear our image cache.
303 FreePlatformCaches(); 303 FreePlatformCaches();
304 theme_pack_ = NULL; 304 theme_pack_ = NULL;
305 305
306 profile_->GetPrefs()->ClearPref(prefs::kCurrentThemePackFilename); 306 profile_->GetPrefs()->ClearPref(prefs::kCurrentThemePackFilename);
307 SaveThemeID(kDefaultThemeID); 307 SaveThemeID(kDefaultThemeID);
308
309 RemoveUnusedThemes();
308 } 310 }
309 311
310 void ThemeService::LoadThemePrefs() { 312 void ThemeService::LoadThemePrefs() {
311 PrefService* prefs = profile_->GetPrefs(); 313 PrefService* prefs = profile_->GetPrefs();
312 314
313 std::string current_id = GetThemeID(); 315 std::string current_id = GetThemeID();
314 if (current_id == kDefaultThemeID) { 316 if (current_id == kDefaultThemeID) {
315 set_ready(); 317 set_ready();
316 return; 318 return;
317 } 319 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 void ThemeService::OnInfobarDestroyed() { 424 void ThemeService::OnInfobarDestroyed() {
423 number_of_infobars_--; 425 number_of_infobars_--;
424 426
425 if (number_of_infobars_ == 0) 427 if (number_of_infobars_ == 0)
426 RemoveUnusedThemes(); 428 RemoveUnusedThemes();
427 } 429 }
428 430
429 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { 431 ThemeSyncableService* ThemeService::GetThemeSyncableService() const {
430 return theme_syncable_service_.get(); 432 return theme_syncable_service_.get();
431 } 433 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_install_ui_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698