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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 } | 551 } |
552 | 552 |
553 bool RemotePageTarget::Activate() const { | 553 bool RemotePageTarget::Activate() const { |
554 std::string request = base::StringPrintf(kActivatePageRequest, | 554 std::string request = base::StringPrintf(kActivatePageRequest, |
555 remote_id_.c_str()); | 555 remote_id_.c_str()); |
556 browser_->SendJsonRequest(request, base::Bind(&NoOp)); | 556 browser_->SendJsonRequest(request, base::Bind(&NoOp)); |
557 return true; | 557 return true; |
558 } | 558 } |
559 | 559 |
560 bool RemotePageTarget::Close() const { | 560 bool RemotePageTarget::Close() const { |
561 if (IsAttached()) | |
562 return false; | |
563 std::string request = base::StringPrintf(kClosePageRequest, | 561 std::string request = base::StringPrintf(kClosePageRequest, |
564 remote_id_.c_str()); | 562 remote_id_.c_str()); |
565 browser_->SendJsonRequest(request, base::Bind(&NoOp)); | 563 browser_->SendJsonRequest(request, base::Bind(&NoOp)); |
566 return true; | 564 return true; |
567 } | 565 } |
568 | 566 |
569 void RemotePageTarget::Reload() const { | 567 void RemotePageTarget::Reload() const { |
570 browser_->SendProtocolCommand(debug_url_, kPageReloadCommand, NULL, | 568 browser_->SendProtocolCommand(debug_url_, kPageReloadCommand, NULL, |
571 base::Closure()); | 569 base::Closure()); |
572 } | 570 } |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 PrefService* service = profile_->GetPrefs(); | 999 PrefService* service = profile_->GetPrefs(); |
1002 const PrefService::Preference* pref = | 1000 const PrefService::Preference* pref = |
1003 service->FindPreference(prefs::kDevToolsDiscoverUsbDevicesEnabled); | 1001 service->FindPreference(prefs::kDevToolsDiscoverUsbDevicesEnabled); |
1004 const base::Value* pref_value = pref->GetValue(); | 1002 const base::Value* pref_value = pref->GetValue(); |
1005 | 1003 |
1006 bool enabled; | 1004 bool enabled; |
1007 if (pref_value->GetAsBoolean(&enabled) && enabled) { | 1005 if (pref_value->GetAsBoolean(&enabled) && enabled) { |
1008 device_providers_.push_back(new UsbDeviceProvider(profile_)); | 1006 device_providers_.push_back(new UsbDeviceProvider(profile_)); |
1009 } | 1007 } |
1010 } | 1008 } |
OLD | NEW |