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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 remove_list.push_back((*it)->id()); | 233 remove_list.push_back((*it)->id()); |
234 } | 234 } |
235 } | 235 } |
236 for (size_t i = 0; i < remove_list.size(); ++i) | 236 for (size_t i = 0; i < remove_list.size(); ++i) |
237 service->UninstallExtension(remove_list[i], false, NULL); | 237 service->UninstallExtension(remove_list[i], false, NULL); |
238 } | 238 } |
239 | 239 |
240 void ThemeService::UseDefaultTheme() { | 240 void ThemeService::UseDefaultTheme() { |
241 ClearAllThemeData(); | 241 ClearAllThemeData(); |
242 NotifyThemeChanged(); | 242 NotifyThemeChanged(); |
243 RemoveUnusedThemes(); | |
pkotwicz
2013/04/04 17:03:53
You should call RemoveUnusedThemes() at the end of
ckocagil
2013/04/05 18:12:03
Done.
| |
243 content::RecordAction(UserMetricsAction("Themes_Reset")); | 244 content::RecordAction(UserMetricsAction("Themes_Reset")); |
244 } | 245 } |
245 | 246 |
246 void ThemeService::SetNativeTheme() { | 247 void ThemeService::SetNativeTheme() { |
247 UseDefaultTheme(); | 248 UseDefaultTheme(); |
248 } | 249 } |
249 | 250 |
250 bool ThemeService::UsingDefaultTheme() const { | 251 bool ThemeService::UsingDefaultTheme() const { |
251 std::string id = GetThemeID(); | 252 std::string id = GetThemeID(); |
252 return id == ThemeService::kDefaultThemeID || | 253 return id == ThemeService::kDefaultThemeID || |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
384 void ThemeService::OnInfobarDestroyed() { | 385 void ThemeService::OnInfobarDestroyed() { |
385 number_of_infobars_--; | 386 number_of_infobars_--; |
386 | 387 |
387 if (number_of_infobars_ == 0) | 388 if (number_of_infobars_ == 0) |
388 RemoveUnusedThemes(); | 389 RemoveUnusedThemes(); |
389 } | 390 } |
390 | 391 |
391 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { | 392 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { |
392 return theme_syncable_service_.get(); | 393 return theme_syncable_service_.get(); |
393 } | 394 } |
OLD | NEW |