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

Side by Side Diff: chrome/browser/ui/ash/cast_config_client_media_router.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
« no previous file with comments | « no previous file | chrome/browser/ui/ash/chrome_new_window_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/cast_config_client_media_router.h" 5 #include "chrome/browser/ui/ash/cast_config_client_media_router.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 content::NotificationService::AllSources()); 147 content::NotificationService::AllSources());
148 148
149 // When starting up, we need to connect to ash and set ourselves as the 149 // When starting up, we need to connect to ash and set ourselves as the
150 // client. 150 // client.
151 content::ServiceManagerConnection::GetForProcess() 151 content::ServiceManagerConnection::GetForProcess()
152 ->GetConnector() 152 ->GetConnector()
153 ->BindInterface(ash_util::GetAshServiceName(), &cast_config_); 153 ->BindInterface(ash_util::GetAshServiceName(), &cast_config_);
154 154
155 // Register this object as the client interface implementation. 155 // Register this object as the client interface implementation.
156 ash::mojom::CastConfigClientAssociatedPtrInfo ptr_info; 156 ash::mojom::CastConfigClientAssociatedPtrInfo ptr_info;
157 binding_.Bind(&ptr_info, cast_config_.associated_group()); 157 binding_.Bind(&ptr_info);
158 cast_config_->SetClient(std::move(ptr_info)); 158 cast_config_->SetClient(std::move(ptr_info));
159 } 159 }
160 160
161 CastConfigClientMediaRouter::~CastConfigClientMediaRouter() {} 161 CastConfigClientMediaRouter::~CastConfigClientMediaRouter() {}
162 162
163 CastDeviceCache* CastConfigClientMediaRouter::devices() { 163 CastDeviceCache* CastConfigClientMediaRouter::devices() {
164 // The CastDeviceCache instance is lazily allocated because the MediaRouter 164 // The CastDeviceCache instance is lazily allocated because the MediaRouter
165 // component is not ready when the constructor is invoked. 165 // component is not ready when the constructor is invoked.
166 if (!devices_ && GetMediaRouter()) { 166 if (!devices_ && GetMediaRouter()) {
167 devices_ = base::MakeUnique<CastDeviceCache>(this); 167 devices_ = base::MakeUnique<CastDeviceCache>(this);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 switch (type) { 242 switch (type) {
243 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: 243 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED:
244 // The active profile has changed, which means that the media router has 244 // The active profile has changed, which means that the media router has
245 // as well. Reset the device cache to ensure we are using up-to-date 245 // as well. Reset the device cache to ensure we are using up-to-date
246 // object instances. 246 // object instances.
247 devices_.reset(); 247 devices_.reset();
248 RequestDeviceRefresh(); 248 RequestDeviceRefresh();
249 break; 249 break;
250 } 250 }
251 } 251 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/ash/chrome_new_window_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698