Chromium Code Reviews| 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/browser/content_settings/host_content_settings_map_factory.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 8 #include "chrome/browser/plugins/plugin_utils.h" | 8 #include "chrome/browser/plugins/plugin_utils.h" |
| 9 #include "chrome/browser/plugins/plugins_field_trial.h" | 9 #include "chrome/browser/plugins/plugins_field_trial.h" |
| 10 #include "chrome/common/chrome_features.h" | 10 #include "chrome/common/chrome_features.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 label = l10n_util::GetStringUTF16( | 44 label = l10n_util::GetStringUTF16( |
| 45 IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_BLOCK); | 45 IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_BLOCK); |
| 46 break; | 46 break; |
| 47 case CONTENT_SETTING_ASK: | 47 case CONTENT_SETTING_ASK: |
| 48 label = | 48 label = |
| 49 l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_ASK); | 49 l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_ASK); |
| 50 break; | 50 break; |
| 51 case CONTENT_SETTING_DETECT_IMPORTANT_CONTENT: | 51 case CONTENT_SETTING_DETECT_IMPORTANT_CONTENT: |
| 52 // TODO(tommycli): We display the ASK string for DETECT because with | 52 // TODO(tommycli): We display the ASK string for DETECT because with |
| 53 // HTML5 by Default, Chrome will ask before running Flash on most sites. | 53 // HTML5 by Default, Chrome will ask before running Flash on most sites. |
| 54 // Once the feature flag is gone, migrate the actual setting to ASK. | 54 // Once the feature flag is gone, migrate the actual setting to ASK. |
|
raymes
2017/03/05 23:56:50
I think this TODO is inaccurate now?
tommycli
2017/03/06 19:10:26
Yes that's right. it's inaccurate. Though maybe it
| |
| 55 label = l10n_util::GetStringUTF16( | 55 label = l10n_util::GetStringUTF16( |
| 56 PluginUtils::ShouldPreferHtmlOverPlugins(host_content_settings_map_) | 56 IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_DETECT_IMPORTANT_CONTENT); |
| 57 ? IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_ASK | |
| 58 : IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_DETECT_IMPORTANT_CONTENT) ; | |
| 59 break; | 57 break; |
| 60 case CONTENT_SETTING_NUM_SETTINGS: | 58 case CONTENT_SETTING_NUM_SETTINGS: |
| 61 NOTREACHED(); | 59 NOTREACHED(); |
| 62 default: | 60 default: |
| 63 break; | 61 break; |
| 64 } | 62 } |
| 65 | 63 |
| 66 // The Material UI for site settings uses comboboxes instead of menubuttons, | 64 // The Material UI for site settings uses comboboxes instead of menubuttons, |
| 67 // which means the elements of the menu themselves have to be shorter, instead | 65 // which means the elements of the menu themselves have to be shorter, instead |
| 68 // of simply setting a shorter label on the menubutton. | 66 // of simply setting a shorter label on the menubutton. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 } | 133 } |
| 136 | 134 |
| 137 bool PermissionMenuModel::IsCommandIdEnabled(int command_id) const { | 135 bool PermissionMenuModel::IsCommandIdEnabled(int command_id) const { |
| 138 return true; | 136 return true; |
| 139 } | 137 } |
| 140 | 138 |
| 141 void PermissionMenuModel::ExecuteCommand(int command_id, int event_flags) { | 139 void PermissionMenuModel::ExecuteCommand(int command_id, int event_flags) { |
| 142 permission_.setting = static_cast<ContentSetting>(command_id); | 140 permission_.setting = static_cast<ContentSetting>(command_id); |
| 143 callback_.Run(permission_); | 141 callback_.Run(permission_); |
| 144 } | 142 } |
| OLD | NEW |