OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ash/media_client.h" | 5 #include "chrome/browser/ui/ash/media_client.h" |
6 | 6 |
| 7 #include "ash/public/interfaces/constants.mojom.h" |
7 #include "base/location.h" | 8 #include "base/location.h" |
8 #include "base/logging.h" | 9 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
10 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
11 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
12 #include "chrome/browser/chromeos/extensions/media_player_api.h" | 13 #include "chrome/browser/chromeos/extensions/media_player_api.h" |
13 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" | 14 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" |
14 #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" | 15 #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" |
15 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
16 #include "chrome/browser/ui/ash/ash_util.h" | |
17 #include "chrome/browser/ui/ash/chrome_shell_content_state.h" | 17 #include "chrome/browser/ui/ash/chrome_shell_content_state.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/browser_list.h" | 19 #include "chrome/browser/ui/browser_list.h" |
20 #include "chrome/browser/ui/browser_window.h" | 20 #include "chrome/browser/ui/browser_window.h" |
21 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 21 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
22 #include "components/user_manager/user_manager.h" | 22 #include "components/user_manager/user_manager.h" |
23 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
25 #include "content/public/common/service_manager_connection.h" | 25 #include "content/public/common/service_manager_connection.h" |
26 #include "extensions/browser/app_window/app_window.h" | 26 #include "extensions/browser/app_window/app_window.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 return media_state; | 125 return media_state; |
126 } | 126 } |
127 | 127 |
128 } // namespace | 128 } // namespace |
129 | 129 |
130 MediaClient::MediaClient() : binding_(this), weak_ptr_factory_(this) { | 130 MediaClient::MediaClient() : binding_(this), weak_ptr_factory_(this) { |
131 MediaCaptureDevicesDispatcher::GetInstance()->AddObserver(this); | 131 MediaCaptureDevicesDispatcher::GetInstance()->AddObserver(this); |
132 | 132 |
133 service_manager::Connector* connector = | 133 service_manager::Connector* connector = |
134 content::ServiceManagerConnection::GetForProcess()->GetConnector(); | 134 content::ServiceManagerConnection::GetForProcess()->GetConnector(); |
135 connector->BindInterface(ash_util::GetAshServiceName(), &media_controller_); | 135 connector->BindInterface(ash::mojom::kServiceName, &media_controller_); |
136 | 136 |
137 // Register this object as the client interface implementation. | 137 // Register this object as the client interface implementation. |
138 ash::mojom::MediaClientAssociatedPtrInfo ptr_info; | 138 ash::mojom::MediaClientAssociatedPtrInfo ptr_info; |
139 binding_.Bind(&ptr_info); | 139 binding_.Bind(&ptr_info); |
140 media_controller_->SetClient(std::move(ptr_info)); | 140 media_controller_->SetClient(std::move(ptr_info)); |
141 } | 141 } |
142 | 142 |
143 MediaClient::~MediaClient() { | 143 MediaClient::~MediaClient() { |
144 MediaCaptureDevicesDispatcher::GetInstance()->RemoveObserver(this); | 144 MediaCaptureDevicesDispatcher::GetInstance()->RemoveObserver(this); |
145 } | 145 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 FROM_HERE, base::Bind(&MediaClient::RequestCaptureState, | 190 FROM_HERE, base::Bind(&MediaClient::RequestCaptureState, |
191 weak_ptr_factory_.GetWeakPtr())); | 191 weak_ptr_factory_.GetWeakPtr())); |
192 } | 192 } |
193 | 193 |
194 MediaCaptureState MediaClient::GetMediaCaptureStateByIndex(int user_index) { | 194 MediaCaptureState MediaClient::GetMediaCaptureStateByIndex(int user_index) { |
195 content::BrowserContext* context = | 195 content::BrowserContext* context = |
196 ChromeShellContentState::GetInstance()->GetBrowserContextByIndex( | 196 ChromeShellContentState::GetInstance()->GetBrowserContextByIndex( |
197 user_index); | 197 user_index); |
198 return GetMediaCaptureStateOfAllWebContents(context); | 198 return GetMediaCaptureStateOfAllWebContents(context); |
199 } | 199 } |
OLD | NEW |