1 // Copyright (c) 2012 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_UI_WEBSITE_SETTINGS_PERMISSION_MENU_MODEL_H_
6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_MENU_MODEL_H_
8 #include "chrome/common/content_settings.h"
9 #include "chrome/common/content_settings_types.h"
10 #include "ui/base/models/simple_menu_model.h"
13 class PermissionMenuModel
: public ui::SimpleMenuModel
,
14 public ui::SimpleMenuModel::Delegate
{
17 COMMAND_SET_TO_DEFAULT
,
24 // Executes the command with the given |command_id|.
25 virtual void ExecuteCommand(int command_id
) = 0;
26 // Returns true if the command with the given |command_id| should be
28 virtual bool IsCommandIdChecked(int command_id
) = 0;
31 PermissionMenuModel(Delegate
* delegate
,
33 ContentSettingsType type
,
34 ContentSetting default_setting
,
35 ContentSetting current_setting
);
37 // Overridden from ui::SimpleMenuModel::Delegate:
38 virtual bool IsCommandIdChecked(int command_id
) const OVERRIDE
;
39 virtual bool IsCommandIdEnabled(int command_id
) const OVERRIDE
;
40 virtual bool GetAcceleratorForCommandId(
42 ui::Accelerator
* accelerator
) OVERRIDE
;
43 virtual void ExecuteCommand(int command_id
, int event_flags
) OVERRIDE
;
46 // The delegate of the |PermissionMenuModel|. |delegate_| can be NULL.
49 // The URL of the website for which to display site permissions.
52 DISALLOW_COPY_AND_ASSIGN(PermissionMenuModel
);
55 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_MENU_MODEL_H_