Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: chrome/browser/ui/ash/media_client.cc

Issue 2696233002: Mojo C++ bindings: remove some usage of AssociatedGroup from user code. (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/location.h" 7 #include "base/location.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_util::GetAshServiceName(), &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, media_controller_.associated_group()); 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 }
146 146
147 void MediaClient::HandleMediaNextTrack() { 147 void MediaClient::HandleMediaNextTrack() {
148 extensions::MediaPlayerAPI::Get(ProfileManager::GetActiveUserProfile()) 148 extensions::MediaPlayerAPI::Get(ProfileManager::GetActiveUserProfile())
149 ->media_player_event_router() 149 ->media_player_event_router()
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc ('k') | mojo/public/cpp/bindings/associated_binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698