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/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 Loading... |
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 Loading... |
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 } |
OLD | NEW |