| 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 "ui/message_center/message_center_tray.h" | 5 #include "ui/message_center/message_center_tray.h" |
| 6 | 6 |
| 7 #include "base/observer_list.h" | 7 #include "base/observer_list.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 #include "ui/base/models/simple_menu_model.h" | 10 #include "ui/base/models/simple_menu_model.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 const int kTogglePermissionCommand = 0; | 22 const int kTogglePermissionCommand = 0; |
| 23 const int kShowSettingsCommand = 1; | 23 const int kShowSettingsCommand = 1; |
| 24 | 24 |
| 25 // The model of the context menu for a notification card. | 25 // The model of the context menu for a notification card. |
| 26 class NotificationMenuModel : public ui::SimpleMenuModel, | 26 class NotificationMenuModel : public ui::SimpleMenuModel, |
| 27 public ui::SimpleMenuModel::Delegate { | 27 public ui::SimpleMenuModel::Delegate { |
| 28 public: | 28 public: |
| 29 NotificationMenuModel(MessageCenterTray* tray, | 29 NotificationMenuModel(MessageCenterTray* tray, |
| 30 const NotifierId& notifier_id, | 30 const NotifierId& notifier_id, |
| 31 const base::string16& display_source); | 31 const base::string16& display_source); |
| 32 virtual ~NotificationMenuModel(); | 32 ~NotificationMenuModel() override; |
| 33 | 33 |
| 34 // Overridden from ui::SimpleMenuModel::Delegate: | 34 // Overridden from ui::SimpleMenuModel::Delegate: |
| 35 virtual bool IsCommandIdChecked(int command_id) const override; | 35 bool IsCommandIdChecked(int command_id) const override; |
| 36 virtual bool IsCommandIdEnabled(int command_id) const override; | 36 bool IsCommandIdEnabled(int command_id) const override; |
| 37 virtual bool GetAcceleratorForCommandId( | 37 bool GetAcceleratorForCommandId(int command_id, |
| 38 int command_id, | 38 ui::Accelerator* accelerator) override; |
| 39 ui::Accelerator* accelerator) override; | 39 void ExecuteCommand(int command_id, int event_flags) override; |
| 40 virtual void ExecuteCommand(int command_id, int event_flags) override; | |
| 41 | 40 |
| 42 private: | 41 private: |
| 43 MessageCenterTray* tray_; | 42 MessageCenterTray* tray_; |
| 44 NotifierId notifier_id_; | 43 NotifierId notifier_id_; |
| 45 DISALLOW_COPY_AND_ASSIGN(NotificationMenuModel); | 44 DISALLOW_COPY_AND_ASSIGN(NotificationMenuModel); |
| 46 }; | 45 }; |
| 47 | 46 |
| 48 NotificationMenuModel::NotificationMenuModel( | 47 NotificationMenuModel::NotificationMenuModel( |
| 49 MessageCenterTray* tray, | 48 MessageCenterTray* tray, |
| 50 const NotifierId& notifier_id, | 49 const NotifierId& notifier_id, |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 ShowPopupBubble(); | 255 ShowPopupBubble(); |
| 257 | 256 |
| 258 NotifyMessageCenterTrayChanged(); | 257 NotifyMessageCenterTrayChanged(); |
| 259 } | 258 } |
| 260 | 259 |
| 261 void MessageCenterTray::NotifyMessageCenterTrayChanged() { | 260 void MessageCenterTray::NotifyMessageCenterTrayChanged() { |
| 262 delegate_->OnMessageCenterTrayChanged(); | 261 delegate_->OnMessageCenterTrayChanged(); |
| 263 } | 262 } |
| 264 | 263 |
| 265 } // namespace message_center | 264 } // namespace message_center |
| OLD | NEW |