| OLD | NEW |
| 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 Loading... |
| 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 |
| 49 if (permission_.type != CONTENT_SETTINGS_TYPE_FULLSCREEN) { | 55 if (permission_.type != CONTENT_SETTINGS_TYPE_FULLSCREEN) { |
| 50 label = l10n_util::GetStringUTF16( | 56 label = l10n_util::GetStringUTF16( |
| 51 IDS_WEBSITE_SETTINGS_MENU_ITEM_BLOCK); | 57 IDS_WEBSITE_SETTINGS_MENU_ITEM_BLOCK); |
| 52 AddCheckItem(CONTENT_SETTING_BLOCK, label); | 58 AddCheckItem(CONTENT_SETTING_BLOCK, label); |
| 53 } | 59 } |
| 54 } | 60 } |
| 55 | 61 |
| 56 PermissionMenuModel::PermissionMenuModel(const GURL& url, | 62 PermissionMenuModel::PermissionMenuModel(const GURL& url, |
| 57 ContentSetting setting, | 63 ContentSetting setting, |
| 58 const ChangeCallback& callback) | 64 const ChangeCallback& callback) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 81 int command_id, | 87 int command_id, |
| 82 ui::Accelerator* accelerator) { | 88 ui::Accelerator* accelerator) { |
| 83 // Accelerators are not supported. | 89 // Accelerators are not supported. |
| 84 return false; | 90 return false; |
| 85 } | 91 } |
| 86 | 92 |
| 87 void PermissionMenuModel::ExecuteCommand(int command_id, int event_flags) { | 93 void PermissionMenuModel::ExecuteCommand(int command_id, int event_flags) { |
| 88 permission_.setting = static_cast<ContentSetting>(command_id); | 94 permission_.setting = static_cast<ContentSetting>(command_id); |
| 89 callback_.Run(permission_); | 95 callback_.Run(permission_); |
| 90 } | 96 } |
| OLD | NEW |