| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 tray_controller_.autorelease(); | 78 tray_controller_.autorelease(); |
| 79 UpdateStatusItem(); | 79 UpdateStatusItem(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool MessageCenterTrayBridge::ShowNotifierSettings() { | 82 bool MessageCenterTrayBridge::ShowNotifierSettings() { |
| 83 // This method needs to be implemented when the context menu of each | 83 // This method needs to be implemented when the context menu of each |
| 84 // notification is ready and it contains 'settings' menu item. | 84 // notification is ready and it contains 'settings' menu item. |
| 85 return false; | 85 return false; |
| 86 } | 86 } |
| 87 | 87 |
| 88 message_center::MessageCenterTray* |
| 89 MessageCenterTrayBridge::GetMessageCenterTray() { |
| 90 return tray_.get(); |
| 91 } |
| 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 } |
| 93 | 98 |
| 94 // We want a static message center icon while it's visible. | 99 // We want a static message center icon while it's visible. |
| 95 if (message_center()->IsMessageCenterVisible()) | 100 if (message_center()->IsMessageCenterVisible()) |
| 96 return; | 101 return; |
| 97 | 102 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 117 | 122 |
| 118 UpdateStatusItem(); | 123 UpdateStatusItem(); |
| 119 | 124 |
| 120 [status_item_view_ setHighlight:YES]; | 125 [status_item_view_ setHighlight:YES]; |
| 121 NSRect frame = [[status_item_view_ window] frame]; | 126 NSRect frame = [[status_item_view_ window] frame]; |
| 122 [tray_controller_ showTrayAtRightOf:NSMakePoint(NSMinX(frame), | 127 [tray_controller_ showTrayAtRightOf:NSMakePoint(NSMinX(frame), |
| 123 NSMinY(frame)) | 128 NSMinY(frame)) |
| 124 atLeftOf:NSMakePoint(NSMaxX(frame), | 129 atLeftOf:NSMakePoint(NSMaxX(frame), |
| 125 NSMinY(frame))]; | 130 NSMinY(frame))]; |
| 126 } | 131 } |
| OLD | NEW |