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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 DevToolsClientHost* client_host = manager->GetDevToolsClientHostFor(agent); | 94 DevToolsClientHost* client_host = manager->GetDevToolsClientHostFor(agent); |
95 DevToolsWindow* window = AsDevToolsWindow(client_host); | 95 DevToolsWindow* window = AsDevToolsWindow(client_host); |
96 if (!window || !window->is_docked()) | 96 if (!window || !window->is_docked()) |
97 return NULL; | 97 return NULL; |
98 return window->tab_contents(); | 98 return window->tab_contents(); |
99 } | 99 } |
100 | 100 |
101 // static | 101 // static |
102 bool DevToolsWindow::IsDevToolsWindow(RenderViewHost* window_rvh) { | 102 bool DevToolsWindow::IsDevToolsWindow(RenderViewHost* window_rvh) { |
103 if (g_instances == NULL) | 103 if (g_instances == NULL) |
104 return NULL; | 104 return false; |
105 DevToolsWindowList& instances = g_instances.Get(); | 105 DevToolsWindowList& instances = g_instances.Get(); |
106 for (DevToolsWindowList::iterator it = instances.begin(); | 106 for (DevToolsWindowList::iterator it = instances.begin(); |
107 it != instances.end(); ++it) { | 107 it != instances.end(); ++it) { |
108 if ((*it)->tab_contents_->web_contents()->GetRenderViewHost() == window_rvh) | 108 if ((*it)->tab_contents_->web_contents()->GetRenderViewHost() == window_rvh) |
109 return true; | 109 return true; |
110 } | 110 } |
111 return false; | 111 return false; |
112 } | 112 } |
113 | 113 |
114 // static | 114 // static |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 CallClientFunction("InspectorFrontendAPI.appendedToURL", &url_value); | 754 CallClientFunction("InspectorFrontendAPI.appendedToURL", &url_value); |
755 } | 755 } |
756 | 756 |
757 content::JavaScriptDialogCreator* DevToolsWindow::GetJavaScriptDialogCreator() { | 757 content::JavaScriptDialogCreator* DevToolsWindow::GetJavaScriptDialogCreator() { |
758 if (inspected_tab_ && inspected_tab_->web_contents()->GetDelegate()) { | 758 if (inspected_tab_ && inspected_tab_->web_contents()->GetDelegate()) { |
759 return inspected_tab_->web_contents()->GetDelegate()-> | 759 return inspected_tab_->web_contents()->GetDelegate()-> |
760 GetJavaScriptDialogCreator(); | 760 GetJavaScriptDialogCreator(); |
761 } | 761 } |
762 return content::WebContentsDelegate::GetJavaScriptDialogCreator(); | 762 return content::WebContentsDelegate::GetJavaScriptDialogCreator(); |
763 } | 763 } |
OLD | NEW |