Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / notifications / notification_options_menu_model.h
blob67b171af65ee81a32af9a8c05aa6f323e74eee0e
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"
13 class Balloon;
15 // Model for the corner-selection submenu.
16 class CornerSelectionMenuModel : public ui::SimpleMenuModel,
17 public ui::SimpleMenuModel::Delegate {
18 public:
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(
26 int command_id,
27 ui::Accelerator* accelerator) OVERRIDE;
28 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
30 private:
31 // Not owned.
32 Balloon* balloon_;
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 {
40 public:
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(
52 int command_id,
53 ui::Accelerator* accelerator) OVERRIDE;
54 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
56 private:
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_