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/webrtc/media_capture_devices_dispatcher.h" |
11 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 11 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
12 | 12 |
13 ContentSettingMediaMenuModel::ContentSettingMediaMenuModel( | 13 ContentSettingMediaMenuModel::ContentSettingMediaMenuModel( |
14 content::MediaStreamType type, | 14 content::MediaStreamType type, |
15 ContentSettingBubbleModel* bubble_model, | 15 ContentSettingBubbleModel* bubble_model, |
16 const MenuLabelChangedCallback& callback) | 16 const MenuLabelChangedCallback& callback) |
17 : ui::SimpleMenuModel(this), | 17 : ui::SimpleMenuModel(this), |
18 type_(type), | 18 type_(type), |
19 media_bubble_model_(bubble_model), | 19 media_bubble_model_(bubble_model), |
20 callback_(callback) { | 20 callback_(callback) { |
(...skipping 26 matching lines...) Expand all Loading... |
47 | 47 |
48 void ContentSettingMediaMenuModel::ExecuteCommand(int command_id, | 48 void ContentSettingMediaMenuModel::ExecuteCommand(int command_id, |
49 int event_flags) { | 49 int event_flags) { |
50 CommandMap::const_iterator it = commands_.find(command_id); | 50 CommandMap::const_iterator it = commands_.find(command_id); |
51 DCHECK(it != commands_.end()); | 51 DCHECK(it != commands_.end()); |
52 media_bubble_model_->OnMediaMenuClicked(type_, it->second.id); | 52 media_bubble_model_->OnMediaMenuClicked(type_, it->second.id); |
53 | 53 |
54 if (!callback_.is_null()) | 54 if (!callback_.is_null()) |
55 callback_.Run(type_, it->second.name); | 55 callback_.Run(type_, it->second.name); |
56 } | 56 } |
OLD | NEW |