diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-13 23:34:49 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-13 23:34:49 +0000 |
commit | 5dd768219a3b7f413f2922a9007f1d736d3768d1 (patch) | |
tree | f8cd9f904c6fdb9e579b7fff9024a2c6cdcdc4cc | |
parent | d1a5941efcd68dddd76d411f276353f34bb93f76 (diff) | |
download | chromium_src-5dd768219a3b7f413f2922a9007f1d736d3768d1.zip chromium_src-5dd768219a3b7f413f2922a9007f1d736d3768d1.tar.gz chromium_src-5dd768219a3b7f413f2922a9007f1d736d3768d1.tar.bz2 |
Address bug 12392 by only updating the PRIMARY selection if we are currently
handling an InputEvent
BUG=12392
TEST=navigate to facebook.com, PRIMARY selection should not contain "Email"
afterward
patch by Steve VanDeBogart <vandebo [at] google>
original review: http://codereview.chromium.org/165471
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23387 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/renderer/render_view.cc | 2 | ||||
-rw-r--r-- | chrome/renderer/render_widget.cc | 7 | ||||
-rw-r--r-- | chrome/renderer/render_widget.h | 3 |
3 files changed, 11 insertions, 1 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index ce9870f..1ddf4cc 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -2512,6 +2512,8 @@ void RenderView::SetTooltipText(WebView* webview, void RenderView::DidChangeSelection(bool is_empty_selection) { #if defined(OS_LINUX) + if (!handling_input_event_) + return; // TODO(estade): investigate incremental updates to the selection so that we // don't send the entire selection over IPC every time. if (!is_empty_selection) { diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 6f2d5fc..3e11f4c8 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -54,6 +54,7 @@ RenderWidget::RenderWidget(RenderThreadBase* render_thread, bool activatable) is_hidden_(false), needs_repainting_on_restore_(false), has_focus_(false), + handling_input_event_(false), closing_(false), ime_is_active_(false), ime_control_enable_ime_(true), @@ -292,8 +293,11 @@ void RenderWidget::OnHandleInputEvent(const IPC::Message& message) { const char* data; int data_length; - if (!message.ReadData(&iter, &data, &data_length)) + handling_input_event_ = true; + if (!message.ReadData(&iter, &data, &data_length)) { + handling_input_event_ = false; return; + } const WebInputEvent* input_event = reinterpret_cast<const WebInputEvent*>(data); @@ -306,6 +310,7 @@ void RenderWidget::OnHandleInputEvent(const IPC::Message& message) { response->WriteBool(processed); Send(response); + handling_input_event_ = false; } void RenderWidget::OnMouseCaptureLost() { diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h index ea7ef5e..7987d28 100644 --- a/chrome/renderer/render_widget.h +++ b/chrome/renderer/render_widget.h @@ -260,6 +260,9 @@ class RenderWidget : public IPC::Channel::Listener, // Indicates whether we have been focused/unfocused by the browser. bool has_focus_; + // Are we currently handling an input event? + bool handling_input_event_; + // True if we have requested this widget be closed. No more messages will // be sent, except for a Close. bool closing_; |