| OLD | NEW |
| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 CastConfigClientMediaRouter::CastConfigClientMediaRouter() : binding_(this) { | 143 CastConfigClientMediaRouter::CastConfigClientMediaRouter() : binding_(this) { |
| 144 // TODO(jdufault): This should use a callback interface once there is an | 144 // TODO(jdufault): This should use a callback interface once there is an |
| 145 // equivalent. See crbug.com/666005. | 145 // equivalent. See crbug.com/666005. |
| 146 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 146 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 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 ->ConnectToInterface(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, cast_config_.associated_group()); |
| 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() { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |