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

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

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 }; 117 };
118 118
119 // A class registered for C++ notifications. This is used to detect changes in 119 // A class registered for C++ notifications. This is used to detect changes in
120 // preferences and upgrade available notifications. Bridges the notification 120 // preferences and upgrade available notifications. Bridges the notification
121 // back to the ToolbarController. 121 // back to the ToolbarController.
122 class NotificationBridge : public NotificationObserver { 122 class NotificationBridge : public NotificationObserver {
123 public: 123 public:
124 explicit NotificationBridge(ToolbarController* controller) 124 explicit NotificationBridge(ToolbarController* controller)
125 : controller_(controller) { 125 : controller_(controller) {
126 registrar_.Add(this, NotificationType::UPGRADE_RECOMMENDED, 126 registrar_.Add(this, chrome::UPGRADE_RECOMMENDED,
127 NotificationService::AllSources()); 127 NotificationService::AllSources());
128 } 128 }
129 129
130 // Overridden from NotificationObserver: 130 // Overridden from NotificationObserver:
131 virtual void Observe(NotificationType type, 131 virtual void Observe(NotificationType type,
132 const NotificationSource& source, 132 const NotificationSource& source,
133 const NotificationDetails& details) { 133 const NotificationDetails& details) {
134 switch (type.value) { 134 switch (type.value) {
135 case NotificationType::PREF_CHANGED: 135 case chrome::PREF_CHANGED:
136 [controller_ prefChanged:Details<std::string>(details).ptr()]; 136 [controller_ prefChanged:Details<std::string>(details).ptr()];
137 break; 137 break;
138 case NotificationType::UPGRADE_RECOMMENDED: 138 case chrome::UPGRADE_RECOMMENDED:
139 [controller_ badgeWrenchMenuIfNeeded]; 139 [controller_ badgeWrenchMenuIfNeeded];
140 break; 140 break;
141 default: 141 default:
142 NOTREACHED(); 142 NOTREACHED();
143 } 143 }
144 } 144 }
145 145
146 private: 146 private:
147 ToolbarController* controller_; // weak, owns us 147 ToolbarController* controller_; // weak, owns us
148 148
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { 787 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point {
788 // Do nothing. 788 // Do nothing.
789 } 789 }
790 790
791 // (URLDropTargetController protocol) 791 // (URLDropTargetController protocol)
792 - (void)hideDropURLsIndicatorInView:(NSView*)view { 792 - (void)hideDropURLsIndicatorInView:(NSView*)view {
793 // Do nothing. 793 // Do nothing.
794 } 794 }
795 795
796 @end 796 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698