OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ui/cocoa/notifications/message_center_tray_bridge.h" | 5 #include "chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/i18n/number_formatting.h" | 8 #include "base/i18n/number_formatting.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 tray_controller_.autorelease(); | 73 tray_controller_.autorelease(); |
74 UpdateStatusItem(); | 74 UpdateStatusItem(); |
75 } | 75 } |
76 | 76 |
77 bool MessageCenterTrayBridge::ShowNotifierSettings() { | 77 bool MessageCenterTrayBridge::ShowNotifierSettings() { |
78 // This method needs to be implemented when the context menu of each | 78 // This method needs to be implemented when the context menu of each |
79 // notification is ready and it contains 'settings' menu item. | 79 // notification is ready and it contains 'settings' menu item. |
80 return false; | 80 return false; |
81 } | 81 } |
82 | 82 |
| 83 bool MessageCenterTrayBridge::IsContextMenuEnabled() const { |
| 84 // Cocoa message center doesn't support context menu yet. |
| 85 return false; |
| 86 } |
| 87 |
83 message_center::MessageCenterTray* | 88 message_center::MessageCenterTray* |
84 MessageCenterTrayBridge::GetMessageCenterTray() { | 89 MessageCenterTrayBridge::GetMessageCenterTray() { |
85 return tray_.get(); | 90 return tray_.get(); |
86 } | 91 } |
87 | 92 |
88 void MessageCenterTrayBridge::UpdateStatusItem() { | 93 void MessageCenterTrayBridge::UpdateStatusItem() { |
89 if (!status_item_view_) { | 94 if (!status_item_view_) { |
90 status_item_view_.reset([[MCStatusItemView alloc] init]); | 95 status_item_view_.reset([[MCStatusItemView alloc] init]); |
91 [status_item_view_ setCallback:^{ tray_->ToggleMessageCenterBubble(); }]; | 96 [status_item_view_ setCallback:^{ tray_->ToggleMessageCenterBubble(); }]; |
92 } | 97 } |
(...skipping 27 matching lines...) Expand all Loading... |
120 | 125 |
121 UpdateStatusItem(); | 126 UpdateStatusItem(); |
122 | 127 |
123 [status_item_view_ setHighlight:YES]; | 128 [status_item_view_ setHighlight:YES]; |
124 NSRect frame = [[status_item_view_ window] frame]; | 129 NSRect frame = [[status_item_view_ window] frame]; |
125 [tray_controller_ showTrayAtRightOf:NSMakePoint(NSMinX(frame), | 130 [tray_controller_ showTrayAtRightOf:NSMakePoint(NSMinX(frame), |
126 NSMinY(frame)) | 131 NSMinY(frame)) |
127 atLeftOf:NSMakePoint(NSMaxX(frame), | 132 atLeftOf:NSMakePoint(NSMaxX(frame), |
128 NSMinY(frame))]; | 133 NSMinY(frame))]; |
129 } | 134 } |
OLD | NEW |