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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OPTIONS_MENU_MODEL_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OPTIONS_MENU_MODEL_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "ui/base/models/simple_menu_model.h"
15 // Model for the corner-selection submenu.
16 class CornerSelectionMenuModel
: public ui::SimpleMenuModel
,
17 public ui::SimpleMenuModel::Delegate
{
19 explicit CornerSelectionMenuModel(Balloon
* balloon
);
20 virtual ~CornerSelectionMenuModel();
22 // Overridden from ui::SimpleMenuModel::Delegate:
23 virtual bool IsCommandIdChecked(int command_id
) const OVERRIDE
;
24 virtual bool IsCommandIdEnabled(int command_id
) const OVERRIDE
;
25 virtual bool GetAcceleratorForCommandId(
27 ui::Accelerator
* accelerator
) OVERRIDE
;
28 virtual void ExecuteCommand(int command_id
, int event_flags
) OVERRIDE
;
34 DISALLOW_COPY_AND_ASSIGN(CornerSelectionMenuModel
);
37 // Model for the notification options menu itself.
38 class NotificationOptionsMenuModel
: public ui::SimpleMenuModel
,
39 public ui::SimpleMenuModel::Delegate
{
41 explicit NotificationOptionsMenuModel(Balloon
* balloon
);
42 virtual ~NotificationOptionsMenuModel();
44 // Overridden from ui::SimpleMenuModel:
45 virtual bool IsItemForCommandIdDynamic(int command_id
) const OVERRIDE
;
46 virtual base::string16
GetLabelForCommandId(int command_id
) const OVERRIDE
;
48 // Overridden from ui::SimpleMenuModel::Delegate:
49 virtual bool IsCommandIdChecked(int command_id
) const OVERRIDE
;
50 virtual bool IsCommandIdEnabled(int command_id
) const OVERRIDE
;
51 virtual bool GetAcceleratorForCommandId(
53 ui::Accelerator
* accelerator
) OVERRIDE
;
54 virtual void ExecuteCommand(int command_id
, int event_flags
) OVERRIDE
;
57 Balloon
* balloon_
; // Not owned.
59 scoped_ptr
<CornerSelectionMenuModel
> corner_menu_model_
;
61 DISALLOW_COPY_AND_ASSIGN(NotificationOptionsMenuModel
);
64 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OPTIONS_MENU_MODEL_H_