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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 void InspectUI::Reload(const std::string& source_id, | 306 void InspectUI::Reload(const std::string& source_id, |
307 const std::string& target_id) { | 307 const std::string& target_id) { |
308 DevToolsTargetImpl* target = FindTarget(source_id, target_id); | 308 DevToolsTargetImpl* target = FindTarget(source_id, target_id); |
309 if (target) { | 309 if (target) { |
310 const std::string target_type = target->GetType(); | 310 const std::string target_type = target->GetType(); |
311 target->Reload(); | 311 target->Reload(); |
312 ForceUpdateIfNeeded(source_id, target_type); | 312 ForceUpdateIfNeeded(source_id, target_type); |
313 } | 313 } |
314 } | 314 } |
315 | 315 |
316 static void NoOp(DevToolsTargetImpl*) {} | |
317 | |
318 void InspectUI::Open(const std::string& source_id, | 316 void InspectUI::Open(const std::string& source_id, |
319 const std::string& browser_id, | 317 const std::string& browser_id, |
320 const std::string& url) { | 318 const std::string& url) { |
321 DevToolsTargetsUIHandler* handler = FindTargetHandler(source_id); | 319 DevToolsTargetsUIHandler* handler = FindTargetHandler(source_id); |
322 if (handler) | 320 if (handler) |
323 handler->Open(browser_id, url, base::Bind(&NoOp)); | 321 handler->Open(browser_id, url); |
324 } | 322 } |
325 | 323 |
326 void InspectUI::InspectBrowserWithCustomFrontend( | 324 void InspectUI::InspectBrowserWithCustomFrontend( |
327 const std::string& source_id, | 325 const std::string& source_id, |
328 const std::string& browser_id, | 326 const std::string& browser_id, |
329 const GURL& frontend_url) { | 327 const GURL& frontend_url) { |
330 if (!frontend_url.SchemeIs(content::kChromeUIScheme) && | 328 if (!frontend_url.SchemeIs(content::kChromeUIScheme) && |
331 !frontend_url.SchemeIs(content::kChromeDevToolsScheme) && | 329 !frontend_url.SchemeIs(content::kChromeDevToolsScheme) && |
332 frontend_url.host() != kLocalHost) { | 330 frontend_url.host() != kLocalHost) { |
333 return; | 331 return; |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 handler->ForceUpdate(); | 525 handler->ForceUpdate(); |
528 } | 526 } |
529 | 527 |
530 void InspectUI::PopulatePortStatus(const base::Value& status) { | 528 void InspectUI::PopulatePortStatus(const base::Value& status) { |
531 web_ui()->CallJavascriptFunction("populatePortStatus", status); | 529 web_ui()->CallJavascriptFunction("populatePortStatus", status); |
532 } | 530 } |
533 | 531 |
534 void InspectUI::ShowIncognitoWarning() { | 532 void InspectUI::ShowIncognitoWarning() { |
535 web_ui()->CallJavascriptFunction("showIncognitoWarning"); | 533 web_ui()->CallJavascriptFunction("showIncognitoWarning"); |
536 } | 534 } |
OLD | NEW |