Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: chrome/browser/ui/website_settings/permission_menu_model.h

Issue 10887027: (GTK only) Replace checkboxes with menus and add support for managed settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix clang build Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_MENU_MODEL_H_
6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_MENU_MODEL_H_
7
8 #include "ui/base/models/simple_menu_model.h"
9 #include "chrome/common/content_settings.h"
10 #include "chrome/common/content_settings_types.h"
11
12 class PermissionMenuModel : public ui::SimpleMenuModel,
13 public ui::SimpleMenuModel::Delegate {
14 public:
15 enum CommandID {
16 COMMAND_SET_TO_DEFAULT,
17 COMMAND_SET_TO_ALLOW,
18 COMMAND_SET_TO_BLOCK,
19 };
20
21 class Delegate {
22 public:
23 // Executes the command with the given |command_id|.
24 virtual void ExecuteCommand(int command_id) = 0;
25 // Returns true if the command with the given |command_id| should be
26 // checked.
27 virtual bool IsCommandIdChecked(int command_id) = 0;
28 };
29
30 PermissionMenuModel(Delegate* delegate,
31 ContentSettingsType type,
32 ContentSetting default_setting,
33 ContentSetting current_setting);
34
35 // Overridden from ui::SimpleMenuModel::Delegate:
36 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
37 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
38 virtual bool GetAcceleratorForCommandId(
39 int command_id,
40 ui::Accelerator* accelerator) OVERRIDE;
41 virtual void ExecuteCommand(int command_id) OVERRIDE;
42
43 private:
44 // The delegate of the |PermissionMenuModel|. |delegate_| can be NULL.
45 Delegate* delegate_;
46
47 DISALLOW_COPY_AND_ASSIGN(PermissionMenuModel);
48 };
49
50 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_MENU_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698