diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 19:22:27 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 19:22:27 +0000 |
commit | 961331ed07e81a9505df718ca0210b8beee18cf4 (patch) | |
tree | b3db3359c88c8c84e7f3ab846ad64c202350968a | |
parent | 348646d70dcd3bfbe9c0664ef6033e528943e7d5 (diff) | |
download | chromium_src-961331ed07e81a9505df718ca0210b8beee18cf4.zip chromium_src-961331ed07e81a9505df718ca0210b8beee18cf4.tar.gz chromium_src-961331ed07e81a9505df718ca0210b8beee18cf4.tar.bz2 |
Hook up inspector highlighting again. This time we use
upstream's drawNodeHighlight methods.
BUG=5178
Review URL: http://codereview.chromium.org/31010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10497 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | webkit/glue/inspector_client_impl.cc | 12 | ||||
-rw-r--r-- | webkit/glue/inspector_client_impl.h | 4 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.cc | 7 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.h | 7 | ||||
-rw-r--r-- | webkit/glue/webview_impl.cc | 9 | ||||
-rw-r--r-- | webkit/glue/webview_impl.h | 2 |
7 files changed, 11 insertions, 32 deletions
@@ -19,7 +19,7 @@ deps = { "http://googletest.googlecode.com/svn/trunk@167", "src/third_party/WebKit": - "/trunk/deps/third_party/WebKit@10447", + "/trunk/deps/third_party/WebKit@10496", "src/third_party/icu38": "/trunk/deps/third_party/icu38@10364", diff --git a/webkit/glue/inspector_client_impl.cc b/webkit/glue/inspector_client_impl.cc index cc28821..3ee29a1 100644 --- a/webkit/glue/inspector_client_impl.cc +++ b/webkit/glue/inspector_client_impl.cc @@ -105,7 +105,7 @@ void WebInspectorClient::closeWindow() { inspector_web_view_ = NULL; WebFrameImpl* frame = inspected_web_view_->main_frame(); - if (frame && frame->inspected_node()) + if (inspected_node_) hideHighlight(); if (inspected_web_view_->page()) @@ -145,20 +145,16 @@ static void invalidateNodeBoundingRect(WebViewImpl* web_view) { } void WebInspectorClient::highlight(Node* node) { - WebFrameImpl* frame = inspected_web_view_->main_frame(); - - if (frame->inspected_node()) + if (inspected_node_) hideHighlight(); + inspected_node_ = node; invalidateNodeBoundingRect(inspected_web_view_); - frame->selectNodeFromInspector(node); } void WebInspectorClient::hideHighlight() { - WebFrameImpl* frame = static_cast<WebFrameImpl*>(inspected_web_view_->GetMainFrame()); - + inspected_node_ = 0; invalidateNodeBoundingRect(inspected_web_view_); - frame->selectNodeFromInspector(NULL); } void WebInspectorClient::inspectedURLChanged(const String& newURL) { diff --git a/webkit/glue/inspector_client_impl.h b/webkit/glue/inspector_client_impl.h index 92b1ead..8e8e4fa 100644 --- a/webkit/glue/inspector_client_impl.h +++ b/webkit/glue/inspector_client_impl.h @@ -47,6 +47,10 @@ private: // The WebViewImpl of the page being inspected; gets passed to the constructor scoped_refptr<WebViewImpl> inspected_web_view_; + // The node selected in the web inspector. Used for highlighting it on the + // page. + WebCore::Node* inspected_node_; + // The WebView of the Inspector popup window WebViewImpl* inspector_web_view_; }; diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index 81af58d..a2ecb7e 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -94,6 +94,7 @@ MSVC_PUSH_WARNING_LEVEL(0); #include "HTMLHeadElement.h" #include "HTMLLinkElement.h" #include "HistoryItem.h" +#include "InspectorController.h" #include "markup.h" #include "Page.h" #include "PlatformContextSkia.h" @@ -289,7 +290,6 @@ MSVC_PUSH_DISABLE_WARNING(4355) MSVC_POP_WARNING() currently_loading_request_(NULL), plugin_delegate_(NULL), - inspected_node_(NULL), active_match_frame_(NULL), active_match_index_(-1), locating_active_rect_(false), @@ -954,10 +954,6 @@ void WebFrameImpl::InvalidateIfNecessary() { } } -void WebFrameImpl::selectNodeFromInspector(WebCore::Node* node) { - inspected_node_ = node; -} - void WebFrameImpl::AddMarker(WebCore::Range* range) { // Use a TextIterator to visit the potentially multiple nodes the range // covers. @@ -1457,6 +1453,7 @@ void WebFrameImpl::Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect) { #endif if (frame_->document() && frameview()) { frameview()->paint(&gc, dirty_rect); + frame_->page()->inspectorController()->drawNodeHighlight(gc); } else { gc.fillRect(dirty_rect, Color::white); } diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h index 546b8c9b..cefe3839 100644 --- a/webkit/glue/webframe_impl.h +++ b/webkit/glue/webframe_impl.h @@ -222,10 +222,6 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> { WebDataSourceImpl* GetDataSourceImpl() const; WebDataSourceImpl* GetProvisionalDataSourceImpl() const; - const WebCore::Node* inspected_node() const { - return inspected_node_; - } - void selectNodeFromInspector(WebCore::Node* node); // Returns which frame has an active match. This function should only be @@ -322,9 +318,6 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> { // Handling requests from TextInputController on this frame. scoped_ptr<WebTextInputImpl> webtextinput_impl_; - // The node selected in the web inspector. Used for highlighting it on the page. - WebCore::Node* inspected_node_; - // A way for the main frame to keep track of which frame has an active // match. Should be NULL for all other frames. WebFrameImpl* active_match_frame_; diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc index 4db2ac0..dca001d 100644 --- a/webkit/glue/webview_impl.cc +++ b/webkit/glue/webview_impl.cc @@ -1639,15 +1639,6 @@ void WebViewImpl::StartDragging(const WebDropData& drop_data) { } } -const WebCore::Node* WebViewImpl::getInspectedNode(WebCore::Frame* frame) { - DCHECK(frame); - WebFrameImpl* webframe_impl = WebFrameImpl::FromFrame(frame); - if (!webframe_impl) - return NULL; - - return webframe_impl->inspected_node(); -} - void WebViewImpl::ImageResourceDownloadDone(ImageResourceFetcher* fetcher, bool errored, const SkBitmap& image) { diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h index 2c0a118..c13f419 100644 --- a/webkit/glue/webview_impl.h +++ b/webkit/glue/webview_impl.h @@ -183,8 +183,6 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> { // Start a system drag and drop operation. void StartDragging(const WebDropData& drop_data); - virtual const WebCore::Node* getInspectedNode(WebCore::Frame* frame); - // ImageResourceFetcher callback. void ImageResourceDownloadDone(ImageResourceFetcher* fetcher, bool errored, |