| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 | 8 |
| 9 MSVC_PUSH_WARNING_LEVEL(0); | 9 MSVC_PUSH_WARNING_LEVEL(0); |
| 10 #include "DOMWindow.h" | 10 #include "DOMWindow.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 WebInspectorClient::~WebInspectorClient() { | 44 WebInspectorClient::~WebInspectorClient() { |
| 45 } | 45 } |
| 46 | 46 |
| 47 void WebInspectorClient::inspectorDestroyed() { | 47 void WebInspectorClient::inspectorDestroyed() { |
| 48 delete this; | 48 delete this; |
| 49 } | 49 } |
| 50 | 50 |
| 51 Page* WebInspectorClient::createPage() { | 51 Page* WebInspectorClient::createPage() { |
| 52 if (inspected_web_view_->GetWebDevToolsAgentImpl()) |
| 53 return NULL; |
| 54 |
| 52 WebCore::Page* page; | 55 WebCore::Page* page; |
| 53 | 56 |
| 54 if (inspector_web_view_ != NULL) { | 57 if (inspector_web_view_ != NULL) { |
| 55 page = inspector_web_view_->page(); | 58 page = inspector_web_view_->page(); |
| 56 ASSERT(page != NULL); | 59 ASSERT(page != NULL); |
| 57 if (page != NULL) | 60 if (page != NULL) |
| 58 return page; | 61 return page; |
| 59 } | 62 } |
| 60 | 63 |
| 61 WebViewDelegate* delegate = inspected_web_view_->GetDelegate(); | 64 WebViewDelegate* delegate = inspected_web_view_->GetDelegate(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 91 windowRect.setWidth(kDefaultInspectorHeight); | 94 windowRect.setWidth(kDefaultInspectorHeight); |
| 92 windowRect.setHeight(kDefaultInspectorWidth); | 95 windowRect.setHeight(kDefaultInspectorWidth); |
| 93 page->chrome()->setWindowRect(windowRect); | 96 page->chrome()->setWindowRect(windowRect); |
| 94 | 97 |
| 95 page->chrome()->show(); | 98 page->chrome()->show(); |
| 96 | 99 |
| 97 return page; | 100 return page; |
| 98 } | 101 } |
| 99 | 102 |
| 100 void WebInspectorClient::showWindow() { | 103 void WebInspectorClient::showWindow() { |
| 104 if (inspected_web_view_->GetWebDevToolsAgentImpl()) |
| 105 return; |
| 106 |
| 101 InspectorController* inspector = inspected_web_view_->page()->inspectorControl
ler(); | 107 InspectorController* inspector = inspected_web_view_->page()->inspectorControl
ler(); |
| 102 inspector->setWindowVisible(true); | 108 inspector->setWindowVisible(true); |
| 103 | 109 |
| 104 // Notify the webview delegate of how many resources we're inspecting. | 110 // Notify the webview delegate of how many resources we're inspecting. |
| 105 WebViewDelegate* d = inspected_web_view_->delegate(); | 111 WebViewDelegate* d = inspected_web_view_->delegate(); |
| 106 DCHECK(d); | 112 DCHECK(d); |
| 107 d->WebInspectorOpened(inspector->resources().size()); | 113 d->WebInspectorOpened(inspector->resources().size()); |
| 108 } | 114 } |
| 109 | 115 |
| 110 void WebInspectorClient::closeWindow() { | 116 void WebInspectorClient::closeWindow() { |
| 117 if (inspected_web_view_->GetWebDevToolsAgentImpl()) |
| 118 return; |
| 119 |
| 111 inspector_web_view_ = NULL; | 120 inspector_web_view_ = NULL; |
| 112 | 121 |
| 113 hideHighlight(); | 122 hideHighlight(); |
| 114 | 123 |
| 115 if (inspected_web_view_->page()) | 124 if (inspected_web_view_->page()) |
| 116 inspected_web_view_->page()->inspectorController()->setWindowVisible(false); | 125 inspected_web_view_->page()->inspectorController()->setWindowVisible(false); |
| 117 } | 126 } |
| 118 | 127 |
| 119 bool WebInspectorClient::windowVisible() { | 128 bool WebInspectorClient::windowVisible() { |
| 129 if (inspected_web_view_->GetWebDevToolsAgentImpl()) |
| 130 return false; |
| 131 |
| 120 if (inspector_web_view_ != NULL) { | 132 if (inspector_web_view_ != NULL) { |
| 121 Page* page = inspector_web_view_->page(); | 133 Page* page = inspector_web_view_->page(); |
| 122 ASSERT(page != NULL); | 134 ASSERT(page != NULL); |
| 123 if (page != NULL) | 135 if (page != NULL) |
| 124 return true; | 136 return true; |
| 125 } | 137 } |
| 126 return false; | 138 return false; |
| 127 } | 139 } |
| 128 | 140 |
| 129 void WebInspectorClient::attachWindow() { | 141 void WebInspectorClient::attachWindow() { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 193 } |
| 182 | 194 |
| 183 void WebInspectorClient::storeSetting( | 195 void WebInspectorClient::storeSetting( |
| 184 const String& key, const InspectorController::Setting&) { | 196 const String& key, const InspectorController::Setting&) { |
| 185 NOTIMPLEMENTED(); | 197 NOTIMPLEMENTED(); |
| 186 } | 198 } |
| 187 | 199 |
| 188 void WebInspectorClient::removeSetting(const String& key) { | 200 void WebInspectorClient::removeSetting(const String& key) { |
| 189 NOTIMPLEMENTED(); | 201 NOTIMPLEMENTED(); |
| 190 } | 202 } |
| OLD | NEW |