OLD | NEW |
1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OPTIONS_MENU_MODEL_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OPTIONS_MENU_MODEL_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OPTIONS_MENU_MODEL_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OPTIONS_MENU_MODEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/notifications/balloon.h" | 9 #include "chrome/browser/notifications/balloon.h" |
10 #include "ui/base/models/simple_menu_model.h" | 10 #include "ui/base/models/simple_menu_model.h" |
11 | 11 |
12 // Model for the corner-selection submenu. | 12 // Model for the corner-selection submenu. |
13 class CornerSelectionMenuModel : public ui::SimpleMenuModel, | 13 class CornerSelectionMenuModel : public ui::SimpleMenuModel, |
14 public ui::SimpleMenuModel::Delegate { | 14 public ui::SimpleMenuModel::Delegate { |
15 public: | 15 public: |
16 explicit CornerSelectionMenuModel(Balloon* balloon); | 16 explicit CornerSelectionMenuModel(Balloon* balloon); |
17 virtual ~CornerSelectionMenuModel(); | 17 virtual ~CornerSelectionMenuModel(); |
18 | 18 |
19 // Overridden from ui::SimpleMenuModel::Delegate: | 19 // Overridden from ui::SimpleMenuModel::Delegate: |
20 virtual bool IsCommandIdChecked(int command_id) const; | 20 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
21 virtual bool IsCommandIdEnabled(int command_id) const; | 21 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
22 virtual bool GetAcceleratorForCommandId(int command_id, | 22 virtual bool GetAcceleratorForCommandId( |
23 ui::Accelerator* accelerator); | 23 int command_id, |
24 virtual void ExecuteCommand(int command_id); | 24 ui::Accelerator* accelerator) OVERRIDE; |
| 25 virtual void ExecuteCommand(int command_id) OVERRIDE; |
25 | 26 |
26 private: | 27 private: |
27 // Not owned. | 28 // Not owned. |
28 Balloon* balloon_; | 29 Balloon* balloon_; |
29 | 30 |
30 DISALLOW_COPY_AND_ASSIGN(CornerSelectionMenuModel); | 31 DISALLOW_COPY_AND_ASSIGN(CornerSelectionMenuModel); |
31 }; | 32 }; |
32 | 33 |
33 // Model for the notification options menu itself. | 34 // Model for the notification options menu itself. |
34 class NotificationOptionsMenuModel : public ui::SimpleMenuModel, | 35 class NotificationOptionsMenuModel : public ui::SimpleMenuModel, |
35 public ui::SimpleMenuModel::Delegate { | 36 public ui::SimpleMenuModel::Delegate { |
36 public: | 37 public: |
37 explicit NotificationOptionsMenuModel(Balloon* balloon); | 38 explicit NotificationOptionsMenuModel(Balloon* balloon); |
38 virtual ~NotificationOptionsMenuModel(); | 39 virtual ~NotificationOptionsMenuModel(); |
39 | 40 |
40 // Overridden from ui::SimpleMenuModel: | 41 // Overridden from ui::SimpleMenuModel: |
41 virtual bool IsItemForCommandIdDynamic(int command_id) const; | 42 virtual bool IsItemForCommandIdDynamic(int command_id) const OVERRIDE; |
42 virtual string16 GetLabelForCommandId(int command_id) const; | 43 virtual string16 GetLabelForCommandId(int command_id) const OVERRIDE; |
43 | 44 |
44 // Overridden from ui::SimpleMenuModel::Delegate: | 45 // Overridden from ui::SimpleMenuModel::Delegate: |
45 virtual bool IsCommandIdChecked(int command_id) const; | 46 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
46 virtual bool IsCommandIdEnabled(int command_id) const; | 47 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
47 virtual bool GetAcceleratorForCommandId(int command_id, | 48 virtual bool GetAcceleratorForCommandId( |
48 ui::Accelerator* accelerator); | 49 int command_id, |
49 virtual void ExecuteCommand(int command_id); | 50 ui::Accelerator* accelerator) OVERRIDE; |
| 51 virtual void ExecuteCommand(int command_id) OVERRIDE; |
50 | 52 |
51 private: | 53 private: |
52 Balloon* balloon_; // Not owned. | 54 Balloon* balloon_; // Not owned. |
53 | 55 |
54 scoped_ptr<CornerSelectionMenuModel> corner_menu_model_; | 56 scoped_ptr<CornerSelectionMenuModel> corner_menu_model_; |
55 | 57 |
56 DISALLOW_COPY_AND_ASSIGN(NotificationOptionsMenuModel); | 58 DISALLOW_COPY_AND_ASSIGN(NotificationOptionsMenuModel); |
57 }; | 59 }; |
58 | 60 |
59 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OPTIONS_MENU_MODEL_H_ | 61 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OPTIONS_MENU_MODEL_H_ |
OLD | NEW |