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

Side by Side Diff: chrome/browser/ui/webui/inspect_ui.cc

Issue 2361613002: DevTools: untangle device discovery request from the devtools android bridge. (Closed)
Patch Set: make device hosts profile-independent, plump browser context for inspect. Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/inspect_ui.h" 5 #include "chrome/browser/ui/webui/inspect_ui.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "chrome/browser/devtools/devtools_targets_ui.h" 9 #include "chrome/browser/devtools/devtools_targets_ui.h"
10 #include "chrome/browser/devtools/devtools_ui_bindings.h" 10 #include "chrome/browser/devtools/devtools_ui_bindings.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 UpdatePortForwardingConfig(); 296 UpdatePortForwardingConfig();
297 UpdateTCPDiscoveryEnabled(); 297 UpdateTCPDiscoveryEnabled();
298 UpdateTCPDiscoveryConfig(); 298 UpdateTCPDiscoveryConfig();
299 } 299 }
300 300
301 void InspectUI::Inspect(const std::string& source_id, 301 void InspectUI::Inspect(const std::string& source_id,
302 const std::string& target_id) { 302 const std::string& target_id) {
303 scoped_refptr<DevToolsAgentHost> target = FindTarget(source_id, target_id); 303 scoped_refptr<DevToolsAgentHost> target = FindTarget(source_id, target_id);
304 if (target) { 304 if (target) {
305 const std::string target_type = target->GetType(); 305 const std::string target_type = target->GetType();
306 target->Inspect(); 306 target->Inspect(web_ui()->GetWebContents()->GetBrowserContext());
307 ForceUpdateIfNeeded(source_id, target_type); 307 ForceUpdateIfNeeded(source_id, target_type);
308 } 308 }
309 } 309 }
310 310
311 void InspectUI::Activate(const std::string& source_id, 311 void InspectUI::Activate(const std::string& source_id,
312 const std::string& target_id) { 312 const std::string& target_id) {
313 scoped_refptr<DevToolsAgentHost> target = FindTarget(source_id, target_id); 313 scoped_refptr<DevToolsAgentHost> target = FindTarget(source_id, target_id);
314 if (target) { 314 if (target) {
315 const std::string target_type = target->GetType(); 315 const std::string target_type = target->GetType();
316 target->Activate(); 316 target->Activate();
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 handler->ForceUpdate(); 565 handler->ForceUpdate();
566 } 566 }
567 567
568 void InspectUI::PopulatePortStatus(const base::Value& status) { 568 void InspectUI::PopulatePortStatus(const base::Value& status) {
569 web_ui()->CallJavascriptFunctionUnsafe("populatePortStatus", status); 569 web_ui()->CallJavascriptFunctionUnsafe("populatePortStatus", status);
570 } 570 }
571 571
572 void InspectUI::ShowIncognitoWarning() { 572 void InspectUI::ShowIncognitoWarning() {
573 web_ui()->CallJavascriptFunctionUnsafe("showIncognitoWarning"); 573 web_ui()->CallJavascriptFunctionUnsafe("showIncognitoWarning");
574 } 574 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698