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 #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/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 // A class registered for C++ notifications. This is used to detect changes in | 103 // A class registered for C++ notifications. This is used to detect changes in |
104 // preferences and upgrade available notifications. Bridges the notification | 104 // preferences and upgrade available notifications. Bridges the notification |
105 // back to the ToolbarController. | 105 // back to the ToolbarController. |
106 class NotificationBridge : public WrenchMenuBadgeController::Delegate { | 106 class NotificationBridge : public WrenchMenuBadgeController::Delegate { |
107 public: | 107 public: |
108 explicit NotificationBridge(ToolbarController* controller) | 108 explicit NotificationBridge(ToolbarController* controller) |
109 : controller_(controller), | 109 : controller_(controller), |
110 badge_controller_([controller browser]->profile(), this) { | 110 badge_controller_([controller browser]->profile(), this) { |
111 } | 111 } |
112 virtual ~NotificationBridge() { | 112 ~NotificationBridge() override {} |
113 } | |
114 | 113 |
115 void UpdateBadgeSeverity() { | 114 void UpdateBadgeSeverity() { |
116 badge_controller_.UpdateDelegate(); | 115 badge_controller_.UpdateDelegate(); |
117 } | 116 } |
118 | 117 |
119 virtual void UpdateBadgeSeverity(WrenchMenuBadgeController::BadgeType type, | 118 void UpdateBadgeSeverity(WrenchMenuBadgeController::BadgeType type, |
120 WrenchIconPainter::Severity severity, | 119 WrenchIconPainter::Severity severity, |
121 bool animate) override { | 120 bool animate) override { |
122 [controller_ updateWrenchButtonSeverity:severity animate:animate]; | 121 [controller_ updateWrenchButtonSeverity:severity animate:animate]; |
123 } | 122 } |
124 | 123 |
125 void OnPreferenceChanged(const std::string& pref_name) { | 124 void OnPreferenceChanged(const std::string& pref_name) { |
126 [controller_ prefChanged:pref_name]; | 125 [controller_ prefChanged:pref_name]; |
127 } | 126 } |
128 | 127 |
129 private: | 128 private: |
130 ToolbarController* controller_; // weak, owns us | 129 ToolbarController* controller_; // weak, owns us |
131 | 130 |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 830 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
832 // Do nothing. | 831 // Do nothing. |
833 } | 832 } |
834 | 833 |
835 // (URLDropTargetController protocol) | 834 // (URLDropTargetController protocol) |
836 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 835 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
837 return drag_util::IsUnsupportedDropData(profile_, info); | 836 return drag_util::IsUnsupportedDropData(profile_, info); |
838 } | 837 } |
839 | 838 |
840 @end | 839 @end |
OLD | NEW |