OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_split.h" | 7 #include "base/string_split.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 // Redraw! | 603 // Redraw! |
604 NotificationService* service = NotificationService::current(); | 604 NotificationService* service = NotificationService::current(); |
605 service->Notify(chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 605 service->Notify(chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
606 Source<ThemeService>(this), | 606 Source<ThemeService>(this), |
607 NotificationService::NoDetails()); | 607 NotificationService::NoDetails()); |
608 #if defined(OS_MACOSX) | 608 #if defined(OS_MACOSX) |
609 NotifyPlatformThemeChanged(); | 609 NotifyPlatformThemeChanged(); |
610 #endif // OS_MACOSX | 610 #endif // OS_MACOSX |
611 } | 611 } |
612 | 612 |
613 #if defined(OS_WIN) | 613 #if defined(OS_WIN) || defined(USE_AURA) |
614 void ThemeService::FreePlatformCaches() { | 614 void ThemeService::FreePlatformCaches() { |
615 // Views (Skia) has no platform image cache to clear. | 615 // Views (Skia) has no platform image cache to clear. |
616 } | 616 } |
617 #endif | 617 #endif |
618 | 618 |
619 void ThemeService::Observe(int type, | 619 void ThemeService::Observe(int type, |
620 const NotificationSource& source, | 620 const NotificationSource& source, |
621 const NotificationDetails& details) { | 621 const NotificationDetails& details) { |
622 DCHECK(type == chrome::NOTIFICATION_EXTENSION_LOADED); | 622 DCHECK(type == chrome::NOTIFICATION_EXTENSION_LOADED); |
623 const Extension* extension = Details<const Extension>(details).ptr(); | 623 const Extension* extension = Details<const Extension>(details).ptr(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 void ThemeService::OnInfobarDisplayed() { | 658 void ThemeService::OnInfobarDisplayed() { |
659 number_of_infobars_++; | 659 number_of_infobars_++; |
660 } | 660 } |
661 | 661 |
662 void ThemeService::OnInfobarDestroyed() { | 662 void ThemeService::OnInfobarDestroyed() { |
663 number_of_infobars_--; | 663 number_of_infobars_--; |
664 | 664 |
665 if (number_of_infobars_ == 0) | 665 if (number_of_infobars_ == 0) |
666 RemoveUnusedThemes(); | 666 RemoveUnusedThemes(); |
667 } | 667 } |
OLD | NEW |