| 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 "components/content_settings/core/browser/plugins_field_trial.h" | 8 #include "components/content_settings/core/browser/plugins_field_trial.h" |
| 9 #include "content/public/common/origin_util.h" | 9 #include "content/public/common/origin_util.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 permission_.type, permission_.setting); | 112 permission_.type, permission_.setting); |
| 113 #endif // defined(ENABLE_PLUGINS) | 113 #endif // defined(ENABLE_PLUGINS) |
| 114 | 114 |
| 115 return setting == command_id; | 115 return setting == command_id; |
| 116 } | 116 } |
| 117 | 117 |
| 118 bool PermissionMenuModel::IsCommandIdEnabled(int command_id) const { | 118 bool PermissionMenuModel::IsCommandIdEnabled(int command_id) const { |
| 119 return true; | 119 return true; |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool PermissionMenuModel::GetAcceleratorForCommandId( | |
| 123 int command_id, | |
| 124 ui::Accelerator* accelerator) const { | |
| 125 // Accelerators are not supported. | |
| 126 return false; | |
| 127 } | |
| 128 | |
| 129 void PermissionMenuModel::ExecuteCommand(int command_id, int event_flags) { | 122 void PermissionMenuModel::ExecuteCommand(int command_id, int event_flags) { |
| 130 permission_.setting = static_cast<ContentSetting>(command_id); | 123 permission_.setting = static_cast<ContentSetting>(command_id); |
| 131 callback_.Run(permission_); | 124 callback_.Run(permission_); |
| 132 } | 125 } |
| OLD | NEW |