| 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 <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 DevToolsAndroidBridge::GetBrowserAgentHost( | 667 DevToolsAndroidBridge::GetBrowserAgentHost( |
| 668 scoped_refptr<RemoteBrowser> browser) { | 668 scoped_refptr<RemoteBrowser> browser) { |
| 669 return AgentHostDelegate::GetOrCreateAgentHost( | 669 return AgentHostDelegate::GetOrCreateAgentHost( |
| 670 this, | 670 this, |
| 671 "adb:" + browser->serial() + ":" + browser->socket(), | 671 "adb:" + browser->serial() + ":" + browser->socket(), |
| 672 browser->browser_id_, | 672 browser->browser_id_, |
| 673 kBrowserTargetSocket, | 673 kBrowserTargetSocket, |
| 674 browser->IsWebView()); | 674 browser->IsWebView()); |
| 675 } | 675 } |
| 676 | 676 |
| 677 void DevToolsAndroidBridge::SendJsonRequest( |
| 678 const scoped_refptr<RemoteBrowser>& browser, |
| 679 const std::string& url, |
| 680 const JsonRequestCallback& callback) { |
| 681 SendJsonRequest(browser->browser_id_, url, callback); |
| 682 } |
| 683 |
| 677 scoped_refptr<AndroidDeviceManager::Device> DevToolsAndroidBridge::FindDevice( | 684 scoped_refptr<AndroidDeviceManager::Device> DevToolsAndroidBridge::FindDevice( |
| 678 const std::string& serial) { | 685 const std::string& serial) { |
| 679 DeviceMap::iterator it = device_map_.find(serial); | 686 DeviceMap::iterator it = device_map_.find(serial); |
| 680 return it == device_map_.end() ? nullptr : it->second; | 687 return it == device_map_.end() ? nullptr : it->second; |
| 681 } | 688 } |
| 682 | 689 |
| 683 void DevToolsAndroidBridge::RespondToOpenOnUIThread( | 690 void DevToolsAndroidBridge::RespondToOpenOnUIThread( |
| 684 scoped_refptr<RemoteBrowser> browser, | 691 scoped_refptr<RemoteBrowser> browser, |
| 685 const RemotePageCallback& callback, | 692 const RemotePageCallback& callback, |
| 686 int result, | 693 int result, |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 device_providers.push_back( | 1015 device_providers.push_back( |
| 1009 new WebRTCDeviceProvider(profile_, signin_manager_, token_service_)); | 1016 new WebRTCDeviceProvider(profile_, signin_manager_, token_service_)); |
| 1010 } | 1017 } |
| 1011 | 1018 |
| 1012 device_manager_->SetDeviceProviders(device_providers); | 1019 device_manager_->SetDeviceProviders(device_providers); |
| 1013 if (NeedsDeviceListPolling()) { | 1020 if (NeedsDeviceListPolling()) { |
| 1014 StopDeviceListPolling(); | 1021 StopDeviceListPolling(); |
| 1015 StartDeviceListPolling(); | 1022 StartDeviceListPolling(); |
| 1016 } | 1023 } |
| 1017 } | 1024 } |
| OLD | NEW |