Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1662)

Side by Side Diff: chrome/browser/devtools/device/devtools_android_bridge.cc

Issue 298873007: DevTools: Allow closing targets (workers and remote pages) even if the target is being inspected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/inspect/inspect.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/inspect/inspect.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698