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

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

Issue 825753002: Revert "Fix Website Settings crash with Plugins ASK setting." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 #include "chrome/browser/ui/website_settings/permission_menu_model.h" 5 #include "chrome/browser/ui/website_settings/permission_menu_model.h"
6 6
7 #include "chrome/grit/generated_resources.h" 7 #include "chrome/grit/generated_resources.h"
8 #include "ui/base/l10n/l10n_util.h" 8 #include "ui/base/l10n/l10n_util.h"
9 9
10 PermissionMenuModel::PermissionMenuModel( 10 PermissionMenuModel::PermissionMenuModel(
(...skipping 28 matching lines...) Expand all
39 AddCheckItem(CONTENT_SETTING_DEFAULT, label); 39 AddCheckItem(CONTENT_SETTING_DEFAULT, label);
40 40
41 // Media only support CONTENTE_SETTTING_ALLOW for https. 41 // Media only support CONTENTE_SETTTING_ALLOW for https.
42 if (permission_.type != CONTENT_SETTINGS_TYPE_MEDIASTREAM || 42 if (permission_.type != CONTENT_SETTINGS_TYPE_MEDIASTREAM ||
43 url.SchemeIsSecure()) { 43 url.SchemeIsSecure()) {
44 label = l10n_util::GetStringUTF16( 44 label = l10n_util::GetStringUTF16(
45 IDS_WEBSITE_SETTINGS_MENU_ITEM_ALLOW); 45 IDS_WEBSITE_SETTINGS_MENU_ITEM_ALLOW);
46 AddCheckItem(CONTENT_SETTING_ALLOW, label); 46 AddCheckItem(CONTENT_SETTING_ALLOW, label);
47 } 47 }
48 48
49 if (permission_.type == CONTENT_SETTINGS_TYPE_PLUGINS) {
50 label = l10n_util::GetStringUTF16(
51 IDS_WEBSITE_SETTINGS_MENU_ITEM_ASK);
52 AddCheckItem(CONTENT_SETTING_ASK, label);
53 }
54
55 if (permission_.type != CONTENT_SETTINGS_TYPE_FULLSCREEN) { 49 if (permission_.type != CONTENT_SETTINGS_TYPE_FULLSCREEN) {
56 label = l10n_util::GetStringUTF16( 50 label = l10n_util::GetStringUTF16(
57 IDS_WEBSITE_SETTINGS_MENU_ITEM_BLOCK); 51 IDS_WEBSITE_SETTINGS_MENU_ITEM_BLOCK);
58 AddCheckItem(CONTENT_SETTING_BLOCK, label); 52 AddCheckItem(CONTENT_SETTING_BLOCK, label);
59 } 53 }
60 } 54 }
61 55
62 PermissionMenuModel::PermissionMenuModel(const GURL& url, 56 PermissionMenuModel::PermissionMenuModel(const GURL& url,
63 ContentSetting setting, 57 ContentSetting setting,
64 const ChangeCallback& callback) 58 const ChangeCallback& callback)
(...skipping 22 matching lines...) Expand all
87 int command_id, 81 int command_id,
88 ui::Accelerator* accelerator) { 82 ui::Accelerator* accelerator) {
89 // Accelerators are not supported. 83 // Accelerators are not supported.
90 return false; 84 return false;
91 } 85 }
92 86
93 void PermissionMenuModel::ExecuteCommand(int command_id, int event_flags) { 87 void PermissionMenuModel::ExecuteCommand(int command_id, int event_flags) {
94 permission_.setting = static_cast<ContentSetting>(command_id); 88 permission_.setting = static_cast<ContentSetting>(command_id);
95 callback_.Run(permission_); 89 callback_.Run(permission_);
96 } 90 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/ui/website_settings/website_settings_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698