OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |