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

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

Issue 2617883002: Add a new BindInterface() method to Connector. (Closed)
Patch Set: . Created 3 years, 11 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 "ash/common/session/session_state_delegate.h" 7 #include "ash/common/session/session_state_delegate.h"
8 #include "ash/common/wm_shell.h" 8 #include "ash/common/wm_shell.h"
9 #include "ash/content/shell_content_state.h" 9 #include "ash/content/shell_content_state.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return media_state; 126 return media_state;
127 } 127 }
128 128
129 } // namespace 129 } // namespace
130 130
131 MediaClient::MediaClient() : binding_(this), weak_ptr_factory_(this) { 131 MediaClient::MediaClient() : binding_(this), weak_ptr_factory_(this) {
132 MediaCaptureDevicesDispatcher::GetInstance()->AddObserver(this); 132 MediaCaptureDevicesDispatcher::GetInstance()->AddObserver(this);
133 133
134 service_manager::Connector* connector = 134 service_manager::Connector* connector =
135 content::ServiceManagerConnection::GetForProcess()->GetConnector(); 135 content::ServiceManagerConnection::GetForProcess()->GetConnector();
136 connector->ConnectToInterface(ash_util::GetAshServiceName(), 136 connector->BindInterface(ash_util::GetAshServiceName(), &media_controller_);
137 &media_controller_);
138 137
139 // Register this object as the client interface implementation. 138 // Register this object as the client interface implementation.
140 ash::mojom::MediaClientAssociatedPtrInfo ptr_info; 139 ash::mojom::MediaClientAssociatedPtrInfo ptr_info;
141 binding_.Bind(&ptr_info, media_controller_.associated_group()); 140 binding_.Bind(&ptr_info, media_controller_.associated_group());
142 media_controller_->SetClient(std::move(ptr_info)); 141 media_controller_->SetClient(std::move(ptr_info));
143 } 142 }
144 143
145 MediaClient::~MediaClient() { 144 MediaClient::~MediaClient() {
146 MediaCaptureDevicesDispatcher::GetInstance()->RemoveObserver(this); 145 MediaCaptureDevicesDispatcher::GetInstance()->RemoveObserver(this);
147 } 146 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 FROM_HERE, base::Bind(&MediaClient::RequestCaptureState, 192 FROM_HERE, base::Bind(&MediaClient::RequestCaptureState,
194 weak_ptr_factory_.GetWeakPtr())); 193 weak_ptr_factory_.GetWeakPtr()));
195 } 194 }
196 195
197 MediaCaptureState MediaClient::GetMediaCaptureStateByIndex(int user_index) { 196 MediaCaptureState MediaClient::GetMediaCaptureStateByIndex(int user_index) {
198 content::BrowserContext* context = 197 content::BrowserContext* context =
199 ash::ShellContentState::GetInstance()->GetBrowserContextByIndex( 198 ash::ShellContentState::GetInstance()->GetBrowserContextByIndex(
200 user_index); 199 user_index);
201 return GetMediaCaptureStateOfAllWebContents(context); 200 return GetMediaCaptureStateOfAllWebContents(context);
202 } 201 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc ('k') | chrome/browser/ui/ash/session_controller_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698