| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/content_settings/content_setting_media_menu_model.h" | 5 #include "chrome/browser/ui/content_settings/content_setting_media_menu_model.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 10 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 | 39 |
| 40 bool ContentSettingMediaMenuModel::IsCommandIdChecked(int command_id) const { | 40 bool ContentSettingMediaMenuModel::IsCommandIdChecked(int command_id) const { |
| 41 return false; | 41 return false; |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool ContentSettingMediaMenuModel::IsCommandIdEnabled(int command_id) const { | 44 bool ContentSettingMediaMenuModel::IsCommandIdEnabled(int command_id) const { |
| 45 return true; | 45 return true; |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool ContentSettingMediaMenuModel::GetAcceleratorForCommandId( | |
| 49 int command_id, | |
| 50 ui::Accelerator* accelerator) const { | |
| 51 return false; | |
| 52 } | |
| 53 | |
| 54 void ContentSettingMediaMenuModel::ExecuteCommand(int command_id, | 48 void ContentSettingMediaMenuModel::ExecuteCommand(int command_id, |
| 55 int event_flags) { | 49 int event_flags) { |
| 56 CommandMap::const_iterator it = commands_.find(command_id); | 50 CommandMap::const_iterator it = commands_.find(command_id); |
| 57 DCHECK(it != commands_.end()); | 51 DCHECK(it != commands_.end()); |
| 58 media_bubble_model_->OnMediaMenuClicked(type_, it->second.id); | 52 media_bubble_model_->OnMediaMenuClicked(type_, it->second.id); |
| 59 | 53 |
| 60 if (!callback_.is_null()) | 54 if (!callback_.is_null()) |
| 61 callback_.Run(type_, it->second.name); | 55 callback_.Run(type_, it->second.name); |
| 62 } | 56 } |
| OLD | NEW |