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 <stddef.h> | 7 #include <stddef.h> |
8 | |
9 #include <algorithm> | 8 #include <algorithm> |
10 #include <map> | 9 #include <map> |
11 #include <set> | 10 #include <set> |
| 11 #include <utility> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/base64.h" | 14 #include "base/base64.h" |
15 #include "base/bind.h" | 15 #include "base/bind.h" |
16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
18 #include "base/json/json_reader.h" | 18 #include "base/json/json_reader.h" |
19 #include "base/lazy_instance.h" | 19 #include "base/lazy_instance.h" |
20 #include "base/macros.h" | 20 #include "base/macros.h" |
21 #include "base/memory/singleton.h" | 21 #include "base/memory/singleton.h" |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 if (target_path.empty()) | 649 if (target_path.empty()) |
650 return; | 650 return; |
651 scoped_refptr<AndroidDeviceManager::Device> device( | 651 scoped_refptr<AndroidDeviceManager::Device> device( |
652 FindDevice(browser_id.first)); | 652 FindDevice(browser_id.first)); |
653 if (!device.get()) { | 653 if (!device.get()) { |
654 callback.Run(); | 654 callback.Run(); |
655 return; | 655 return; |
656 } | 656 } |
657 new ProtocolCommand( | 657 new ProtocolCommand( |
658 device, browser_id.second, target_path, | 658 device, browser_id.second, target_path, |
659 DevToolsProtocol::SerializeCommand(1, method, params.Pass()), | 659 DevToolsProtocol::SerializeCommand(1, method, std::move(params)), |
660 callback); | 660 callback); |
661 } | 661 } |
662 | 662 |
663 scoped_refptr<content::DevToolsAgentHost> | 663 scoped_refptr<content::DevToolsAgentHost> |
664 DevToolsAndroidBridge::GetBrowserAgentHost( | 664 DevToolsAndroidBridge::GetBrowserAgentHost( |
665 scoped_refptr<RemoteBrowser> browser) { | 665 scoped_refptr<RemoteBrowser> browser) { |
666 return AgentHostDelegate::GetOrCreateAgentHost( | 666 return AgentHostDelegate::GetOrCreateAgentHost( |
667 this, | 667 this, |
668 "adb:" + browser->serial() + ":" + browser->socket(), | 668 "adb:" + browser->serial() + ":" + browser->socket(), |
669 browser->browser_id_, | 669 browser->browser_id_, |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 device_providers.push_back( | 966 device_providers.push_back( |
967 new WebRTCDeviceProvider(profile_, signin_manager_, token_service_)); | 967 new WebRTCDeviceProvider(profile_, signin_manager_, token_service_)); |
968 } | 968 } |
969 | 969 |
970 device_manager_->SetDeviceProviders(device_providers); | 970 device_manager_->SetDeviceProviders(device_providers); |
971 if (NeedsDeviceListPolling()) { | 971 if (NeedsDeviceListPolling()) { |
972 StopDeviceListPolling(); | 972 StopDeviceListPolling(); |
973 StartDeviceListPolling(); | 973 StartDeviceListPolling(); |
974 } | 974 } |
975 } | 975 } |
OLD | NEW |