OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_SETTINGS_MENU_MODEL_H_ | |
6 #define CHROME_BROWSER_UI_PANELS_PANEL_SETTINGS_MENU_MODEL_H_ | |
7 #pragma once | |
8 | |
9 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | |
10 #include "ui/base/models/simple_menu_model.h" | |
11 | |
12 class Extension; | |
13 class Panel; | |
14 | |
15 class PanelSettingsMenuModel : public ui::SimpleMenuModel, | |
16 public ui::SimpleMenuModel::Delegate, | |
17 public ExtensionUninstallDialog::Delegate { | |
18 public: | |
19 explicit PanelSettingsMenuModel(Panel* panel); | |
20 virtual ~PanelSettingsMenuModel(); | |
21 | |
22 private: | |
23 // Overridden from ui::SimpleMenuModel::Delegate: | |
24 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | |
25 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | |
26 virtual bool GetAcceleratorForCommandId( | |
27 int command_id, ui::Accelerator* accelerator) OVERRIDE; | |
28 virtual void ExecuteCommand(int command_id) OVERRIDE; | |
29 | |
30 // ExtensionUninstallDialog::Delegate: | |
31 virtual void ExtensionUninstallAccepted() OVERRIDE; | |
32 virtual void ExtensionUninstallCanceled() OVERRIDE; | |
33 | |
34 private: | |
35 friend class PanelBrowserTest; | |
36 | |
37 enum { | |
38 COMMAND_NAME = 0, | |
39 COMMAND_CONFIGURE, | |
40 COMMAND_DISABLE, | |
41 COMMAND_UNINSTALL, | |
42 COMMAND_MANAGE | |
43 }; | |
44 | |
45 Panel* panel_; | |
46 scoped_ptr<ExtensionUninstallDialog> extension_uninstall_dialog_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(PanelSettingsMenuModel); | |
49 }; | |
50 | |
51 #endif // CHROME_BROWSER_UI_PANELS_PANEL_SETTINGS_MENU_MODEL_H_ | |
OLD | NEW |