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

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

Issue 562513003: [DevTools] Unify workers and web contents handling in inspect_ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased, fixed comment Created 6 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
« no previous file with comments | « chrome/browser/resources/inspect/inspect.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "chrome/browser/devtools/devtools_target_impl.h" 9 #include "chrome/browser/devtools/devtools_target_impl.h"
10 #include "chrome/browser/devtools/devtools_targets_ui.h" 10 #include "chrome/browser/devtools/devtools_targets_ui.h"
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 void InspectUI::StartListeningNotifications() { 364 void InspectUI::StartListeningNotifications() {
365 if (!target_handlers_.empty()) // Possible when reloading the page. 365 if (!target_handlers_.empty()) // Possible when reloading the page.
366 StopListeningNotifications(); 366 StopListeningNotifications();
367 367
368 Profile* profile = Profile::FromWebUI(web_ui()); 368 Profile* profile = Profile::FromWebUI(web_ui());
369 369
370 DevToolsTargetsUIHandler::Callback callback = 370 DevToolsTargetsUIHandler::Callback callback =
371 base::Bind(&InspectUI::PopulateTargets, base::Unretained(this)); 371 base::Bind(&InspectUI::PopulateTargets, base::Unretained(this));
372 372
373 AddTargetUIHandler( 373 AddTargetUIHandler(
374 DevToolsTargetsUIHandler::CreateForRenderers(callback)); 374 DevToolsTargetsUIHandler::CreateForLocal(callback));
375 AddTargetUIHandler(
376 DevToolsTargetsUIHandler::CreateForWorkers(callback));
377 if (profile->IsOffTheRecord()) { 375 if (profile->IsOffTheRecord()) {
378 ShowIncognitoWarning(); 376 ShowIncognitoWarning();
379 } else { 377 } else {
380 AddTargetUIHandler( 378 AddTargetUIHandler(
381 DevToolsTargetsUIHandler::CreateForAdb(callback, profile)); 379 DevToolsTargetsUIHandler::CreateForAdb(callback, profile));
382 } 380 }
383 381
384 port_status_serializer_.reset( 382 port_status_serializer_.reset(
385 new PortForwardingStatusSerializer( 383 new PortForwardingStatusSerializer(
386 base::Bind(&InspectUI::PopulatePortStatus, base::Unretained(this)), 384 base::Bind(&InspectUI::PopulatePortStatus, base::Unretained(this)),
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 targets); 528 targets);
531 } 529 }
532 530
533 void InspectUI::PopulatePortStatus(const base::Value& status) { 531 void InspectUI::PopulatePortStatus(const base::Value& status) {
534 web_ui()->CallJavascriptFunction("populatePortStatus", status); 532 web_ui()->CallJavascriptFunction("populatePortStatus", status);
535 } 533 }
536 534
537 void InspectUI::ShowIncognitoWarning() { 535 void InspectUI::ShowIncognitoWarning() {
538 web_ui()->CallJavascriptFunction("showIncognitoWarning"); 536 web_ui()->CallJavascriptFunction("showIncognitoWarning");
539 } 537 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/inspect/inspect.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698