| 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/devtools/device/devtools_android_bridge.h" | 5 #include "chrome/browser/devtools/device/devtools_android_bridge.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 259 |
| 260 // static | 260 // static |
| 261 DevToolsAndroidBridge::Factory* DevToolsAndroidBridge::Factory::GetInstance() { | 261 DevToolsAndroidBridge::Factory* DevToolsAndroidBridge::Factory::GetInstance() { |
| 262 return base::Singleton<DevToolsAndroidBridge::Factory>::get(); | 262 return base::Singleton<DevToolsAndroidBridge::Factory>::get(); |
| 263 } | 263 } |
| 264 | 264 |
| 265 // static | 265 // static |
| 266 DevToolsAndroidBridge* DevToolsAndroidBridge::Factory::GetForProfile( | 266 DevToolsAndroidBridge* DevToolsAndroidBridge::Factory::GetForProfile( |
| 267 Profile* profile) { | 267 Profile* profile) { |
| 268 return static_cast<DevToolsAndroidBridge*>(GetInstance()-> | 268 return static_cast<DevToolsAndroidBridge*>(GetInstance()-> |
| 269 GetServiceForBrowserContext(profile, true)); | 269 GetServiceForBrowserContext(profile->GetOriginalProfile(), true)); |
| 270 } | 270 } |
| 271 | 271 |
| 272 DevToolsAndroidBridge::Factory::Factory() | 272 DevToolsAndroidBridge::Factory::Factory() |
| 273 : BrowserContextKeyedServiceFactory( | 273 : BrowserContextKeyedServiceFactory( |
| 274 "DevToolsAndroidBridge", | 274 "DevToolsAndroidBridge", |
| 275 BrowserContextDependencyManager::GetInstance()) { | 275 BrowserContextDependencyManager::GetInstance()) { |
| 276 if (IsWebRTCDeviceProviderEnabled()) { | 276 if (IsWebRTCDeviceProviderEnabled()) { |
| 277 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); | 277 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); |
| 278 DependsOn(SigninManagerFactory::GetInstance()); | 278 DependsOn(SigninManagerFactory::GetInstance()); |
| 279 } | 279 } |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 device_providers.push_back( | 963 device_providers.push_back( |
| 964 new WebRTCDeviceProvider(profile_, signin_manager_, token_service_)); | 964 new WebRTCDeviceProvider(profile_, signin_manager_, token_service_)); |
| 965 } | 965 } |
| 966 | 966 |
| 967 device_manager_->SetDeviceProviders(device_providers); | 967 device_manager_->SetDeviceProviders(device_providers); |
| 968 if (NeedsDeviceListPolling()) { | 968 if (NeedsDeviceListPolling()) { |
| 969 StopDeviceListPolling(); | 969 StopDeviceListPolling(); |
| 970 StartDeviceListPolling(); | 970 StartDeviceListPolling(); |
| 971 } | 971 } |
| 972 } | 972 } |
| OLD | NEW |