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

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

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
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"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/themes/browser_theme_pack.h" 12 #include "chrome/browser/themes/browser_theme_pack.h"
13 #include "chrome/common/chrome_constants.h" 13 #include "chrome/common/chrome_constants.h"
14 #include "chrome/common/chrome_notification_types.h" 14 #include "chrome/common/chrome_notification_types.h"
15 #include "chrome/common/pref_names.h" 15 #include "chrome/common/pref_names.h"
16 #include "content/browser/user_metrics.h" 16 #include "content/browser/user_metrics.h"
17 #include "content/common/notification_service.h" 17 #include "content/public/browser/notification_service.h"
18 #include "grit/theme_resources.h" 18 #include "grit/theme_resources.h"
19 #include "grit/theme_resources_standard.h" 19 #include "grit/theme_resources_standard.h"
20 #include "grit/ui_resources.h" 20 #include "grit/ui_resources.h"
21 #include "ui/base/resource/resource_bundle.h" 21 #include "ui/base/resource/resource_bundle.h"
22 22
23 #if defined(OS_WIN) && !defined(USE_AURA) 23 #if defined(OS_WIN) && !defined(USE_AURA)
24 #include "views/widget/native_widget_win.h" 24 #include "views/widget/native_widget_win.h"
25 #endif 25 #endif
26 26
27 // Strings used in alignment properties. 27 // Strings used in alignment properties.
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 UserMetrics::RecordAction(UserMetricsAction("Themes.Gone")); 590 UserMetrics::RecordAction(UserMetricsAction("Themes.Gone"));
591 } 591 }
592 } 592 }
593 } 593 }
594 } 594 }
595 } 595 }
596 596
597 void ThemeService::NotifyThemeChanged() { 597 void ThemeService::NotifyThemeChanged() {
598 VLOG(1) << "Sending BROWSER_THEME_CHANGED"; 598 VLOG(1) << "Sending BROWSER_THEME_CHANGED";
599 // Redraw! 599 // Redraw!
600 NotificationService* service = NotificationService::current(); 600 content::NotificationService* service =
601 content::NotificationService::current();
601 service->Notify(chrome::NOTIFICATION_BROWSER_THEME_CHANGED, 602 service->Notify(chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
602 content::Source<ThemeService>(this), 603 content::Source<ThemeService>(this),
603 NotificationService::NoDetails()); 604 content::NotificationService::NoDetails());
604 #if defined(OS_MACOSX) 605 #if defined(OS_MACOSX)
605 NotifyPlatformThemeChanged(); 606 NotifyPlatformThemeChanged();
606 #endif // OS_MACOSX 607 #endif // OS_MACOSX
607 } 608 }
608 609
609 #if defined(OS_WIN) || defined(USE_AURA) 610 #if defined(OS_WIN) || defined(USE_AURA)
610 void ThemeService::FreePlatformCaches() { 611 void ThemeService::FreePlatformCaches() {
611 // Views (Skia) has no platform image cache to clear. 612 // Views (Skia) has no platform image cache to clear.
612 } 613 }
613 #endif 614 #endif
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 void ThemeService::OnInfobarDisplayed() { 655 void ThemeService::OnInfobarDisplayed() {
655 number_of_infobars_++; 656 number_of_infobars_++;
656 } 657 }
657 658
658 void ThemeService::OnInfobarDestroyed() { 659 void ThemeService::OnInfobarDestroyed() {
659 number_of_infobars_--; 660 number_of_infobars_--;
660 661
661 if (number_of_infobars_ == 0) 662 if (number_of_infobars_ == 0)
662 RemoveUnusedThemes(); 663 RemoveUnusedThemes();
663 } 664 }
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/task_manager_resource_providers.cc ('k') | chrome/browser/themes/theme_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698