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

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

Issue 2408613002: Replace kPreferHtmlOverPlugins feature checks with PluginUtils::ShouldPreferHtmlOverPlugi… (Closed)
Patch Set: Replace remaining kPreferHtmlOverPlugins feature checks with PluginUtils::ShouldPreferHtmlOverPlugi… Created 4 years, 2 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_MENU_MODEL_H_ 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_MENU_MODEL_H_
6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_MENU_MODEL_H_ 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_MENU_MODEL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/ui/website_settings/website_settings_ui.h" 9 #include "chrome/browser/ui/website_settings/website_settings_ui.h"
10 #include "components/content_settings/core/common/content_settings.h" 10 #include "components/content_settings/core/common/content_settings.h"
11 #include "components/content_settings/core/common/content_settings_types.h" 11 #include "components/content_settings/core/common/content_settings_types.h"
12 #include "ui/base/models/simple_menu_model.h" 12 #include "ui/base/models/simple_menu_model.h"
13 #include "url/gurl.h" 13 #include "url/gurl.h"
14 14
15 class HostContentSettingsMap;
16 class Profile;
17
15 class PermissionMenuModel : public ui::SimpleMenuModel, 18 class PermissionMenuModel : public ui::SimpleMenuModel,
16 public ui::SimpleMenuModel::Delegate { 19 public ui::SimpleMenuModel::Delegate {
17 public: 20 public:
18 typedef base::Callback<void(const WebsiteSettingsUI::PermissionInfo&)> 21 typedef base::Callback<void(const WebsiteSettingsUI::PermissionInfo&)>
19 ChangeCallback; 22 ChangeCallback;
20 23
21 // Create a new menu model for permission settings. 24 // Create a new menu model for permission settings.
22 PermissionMenuModel(const GURL& url, 25 PermissionMenuModel(Profile* profile,
26 const GURL& url,
23 const WebsiteSettingsUI::PermissionInfo& info, 27 const WebsiteSettingsUI::PermissionInfo& info,
24 const ChangeCallback& callback); 28 const ChangeCallback& callback);
25 // Creates a special-case menu model that only has the allow and block 29 // Creates a special-case menu model that only has the allow and block
26 // options. It does not track a permission type. |setting| is the 30 // options. It does not track a permission type. |setting| is the
27 // initial selected option. It must be either CONTENT_SETTING_ALLOW or 31 // initial selected option. It must be either CONTENT_SETTING_ALLOW or
28 // CONTENT_SETTING_BLOCK. 32 // CONTENT_SETTING_BLOCK.
29 PermissionMenuModel(const GURL& url, 33 PermissionMenuModel(Profile* profile,
34 const GURL& url,
30 ContentSetting setting, 35 ContentSetting setting,
31 const ChangeCallback& callback); 36 const ChangeCallback& callback);
32 ~PermissionMenuModel() override; 37 ~PermissionMenuModel() override;
33 38
34 // Overridden from ui::SimpleMenuModel::Delegate: 39 // Overridden from ui::SimpleMenuModel::Delegate:
35 bool IsCommandIdChecked(int command_id) const override; 40 bool IsCommandIdChecked(int command_id) const override;
36 bool IsCommandIdEnabled(int command_id) const override; 41 bool IsCommandIdEnabled(int command_id) const override;
37 void ExecuteCommand(int command_id, int event_flags) override; 42 void ExecuteCommand(int command_id, int event_flags) override;
38 43
39 private: 44 private:
45 HostContentSettingsMap* host_content_settings_map_;
46
40 // The permission info represented by the menu model. 47 // The permission info represented by the menu model.
41 WebsiteSettingsUI::PermissionInfo permission_; 48 WebsiteSettingsUI::PermissionInfo permission_;
42 49
43 // Callback to be called when the permission's setting is changed. 50 // Callback to be called when the permission's setting is changed.
44 ChangeCallback callback_; 51 ChangeCallback callback_;
45 52
46 DISALLOW_COPY_AND_ASSIGN(PermissionMenuModel); 53 DISALLOW_COPY_AND_ASSIGN(PermissionMenuModel);
47 }; 54 };
48 55
49 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_MENU_MODEL_H_ 56 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_MENU_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698