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

Side by Side Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm

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 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" 5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/mac/mac_util.h" 9 #include "base/mac/mac_util.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "chrome/browser/ui/global_error_service.h" 42 #include "chrome/browser/ui/global_error_service.h"
43 #include "chrome/browser/ui/global_error_service_factory.h" 43 #include "chrome/browser/ui/global_error_service_factory.h"
44 #include "chrome/browser/ui/omnibox/omnibox_view.h" 44 #include "chrome/browser/ui/omnibox/omnibox_view.h"
45 #include "chrome/browser/ui/toolbar/toolbar_model.h" 45 #include "chrome/browser/ui/toolbar/toolbar_model.h"
46 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" 46 #include "chrome/browser/ui/toolbar/wrench_menu_model.h"
47 #include "chrome/browser/upgrade_detector.h" 47 #include "chrome/browser/upgrade_detector.h"
48 #include "chrome/common/chrome_notification_types.h" 48 #include "chrome/common/chrome_notification_types.h"
49 #include "chrome/common/pref_names.h" 49 #include "chrome/common/pref_names.h"
50 #include "content/browser/tab_contents/tab_contents.h" 50 #include "content/browser/tab_contents/tab_contents.h"
51 #include "content/public/browser/notification_observer.h" 51 #include "content/public/browser/notification_observer.h"
52 #include "content/common/notification_service.h" 52 #include "content/public/browser/notification_service.h"
53 #include "content/public/browser/notification_details.h" 53 #include "content/public/browser/notification_details.h"
54 #include "grit/chromium_strings.h" 54 #include "grit/chromium_strings.h"
55 #include "grit/generated_resources.h" 55 #include "grit/generated_resources.h"
56 #include "grit/theme_resources.h" 56 #include "grit/theme_resources.h"
57 #include "grit/theme_resources_standard.h" 57 #include "grit/theme_resources_standard.h"
58 #include "ui/base/l10n/l10n_util.h" 58 #include "ui/base/l10n/l10n_util.h"
59 #include "ui/base/l10n/l10n_util_mac.h" 59 #include "ui/base/l10n/l10n_util_mac.h"
60 #include "ui/base/resource/resource_bundle.h" 60 #include "ui/base/resource/resource_bundle.h"
61 #include "ui/gfx/image/image.h" 61 #include "ui/gfx/image/image.h"
62 #include "ui/gfx/rect.h" 62 #include "ui/gfx/rect.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 namespace ToolbarControllerInternal { 97 namespace ToolbarControllerInternal {
98 98
99 // A class registered for C++ notifications. This is used to detect changes in 99 // A class registered for C++ notifications. This is used to detect changes in
100 // preferences and upgrade available notifications. Bridges the notification 100 // preferences and upgrade available notifications. Bridges the notification
101 // back to the ToolbarController. 101 // back to the ToolbarController.
102 class NotificationBridge : public content::NotificationObserver { 102 class NotificationBridge : public content::NotificationObserver {
103 public: 103 public:
104 explicit NotificationBridge(ToolbarController* controller) 104 explicit NotificationBridge(ToolbarController* controller)
105 : controller_(controller) { 105 : controller_(controller) {
106 registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED, 106 registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
107 NotificationService::AllSources()); 107 content::NotificationService::AllSources());
108 registrar_.Add(this, chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED, 108 registrar_.Add(this, chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED,
109 content::Source<Profile>([controller browser]->profile())); 109 content::Source<Profile>([controller browser]->profile()));
110 } 110 }
111 111
112 // Overridden from content::NotificationObserver: 112 // Overridden from content::NotificationObserver:
113 virtual void Observe(int type, 113 virtual void Observe(int type,
114 const content::NotificationSource& source, 114 const content::NotificationSource& source,
115 const content::NotificationDetails& details) { 115 const content::NotificationDetails& details) {
116 switch (type) { 116 switch (type) {
117 case chrome::NOTIFICATION_PREF_CHANGED: 117 case chrome::NOTIFICATION_PREF_CHANGED:
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 - (void)hideDropURLsIndicatorInView:(NSView*)view { 784 - (void)hideDropURLsIndicatorInView:(NSView*)view {
785 // Do nothing. 785 // Do nothing.
786 } 786 }
787 787
788 // (URLDropTargetController protocol) 788 // (URLDropTargetController protocol)
789 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { 789 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info {
790 return drag_util::IsUnsupportedDropData(profile_, info); 790 return drag_util::IsUnsupportedDropData(profile_, info);
791 } 791 }
792 792
793 @end 793 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/theme_install_bubble_view.mm ('k') | chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698