Chromium Code Reviews| 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 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 520 } | 520 } |
| 521 | 521 |
| 522 bool DevToolsAndroidBridge::RemotePageTarget::IsAttached() const { | 522 bool DevToolsAndroidBridge::RemotePageTarget::IsAttached() const { |
| 523 return target_path_.empty(); | 523 return target_path_.empty(); |
| 524 } | 524 } |
| 525 | 525 |
| 526 static void NoOp(int, const std::string&) {} | 526 static void NoOp(int, const std::string&) {} |
| 527 | 527 |
| 528 void DevToolsAndroidBridge::RemotePageTarget::Inspect(Profile* profile) const { | 528 void DevToolsAndroidBridge::RemotePageTarget::Inspect(Profile* profile) const { |
| 529 Activate(); | 529 Activate(); |
| 530 bool isWorker = remote_type_ == kTargetTypeWorker || | 530 bool isWorker = remote_type_ == kTargetTypeWorker || |
|
dgozman
2016/08/10 23:13:43
Please change these to is_worker and is_v8_only.
eostroukhov
2016/08/10 23:31:07
Done.
| |
| 531 remote_type_ == kTargetTypeServiceWorker; | 531 remote_type_ == kTargetTypeServiceWorker; |
| 532 bool isV8 = remote_type_ == kTargetTypeNode; | |
| 532 DevToolsWindow::OpenExternalFrontend(profile, frontend_url_, GetAgentHost(), | 533 DevToolsWindow::OpenExternalFrontend(profile, frontend_url_, GetAgentHost(), |
| 533 isWorker); | 534 isWorker, isV8); |
| 534 } | 535 } |
| 535 | 536 |
| 536 bool DevToolsAndroidBridge::RemotePageTarget::Activate() const { | 537 bool DevToolsAndroidBridge::RemotePageTarget::Activate() const { |
| 537 if (!bridge_) | 538 if (!bridge_) |
| 538 return false; | 539 return false; |
| 539 | 540 |
| 540 std::string request = base::StringPrintf(kActivatePageRequest, | 541 std::string request = base::StringPrintf(kActivatePageRequest, |
| 541 remote_id_.c_str()); | 542 remote_id_.c_str()); |
| 542 bridge_->SendJsonRequest(browser_id_, request, base::Bind(&NoOp)); | 543 bridge_->SendJsonRequest(browser_id_, request, base::Bind(&NoOp)); |
| 543 return true; | 544 return true; |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 945 if (pref_value->GetAsBoolean(&enabled) && enabled) { | 946 if (pref_value->GetAsBoolean(&enabled) && enabled) { |
| 946 device_providers.push_back(new UsbDeviceProvider(profile_)); | 947 device_providers.push_back(new UsbDeviceProvider(profile_)); |
| 947 } | 948 } |
| 948 | 949 |
| 949 device_manager_->SetDeviceProviders(device_providers); | 950 device_manager_->SetDeviceProviders(device_providers); |
| 950 if (NeedsDeviceListPolling()) { | 951 if (NeedsDeviceListPolling()) { |
| 951 StopDeviceListPolling(); | 952 StopDeviceListPolling(); |
| 952 StartDeviceListPolling(); | 953 StartDeviceListPolling(); |
| 953 } | 954 } |
| 954 } | 955 } |
| OLD | NEW |