summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaren@chromium.org <karen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-02 19:43:51 +0000
committerkaren@chromium.org <karen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-02 19:43:51 +0000
commit5bff2c282c44596e839e145db0eac536ae16a339 (patch)
treebf8d1610b6a5737541226dfab8a19285742757bc
parentf2badb2647ebf425b002e277622c88fd0cd5f508 (diff)
downloadchromium_src-5bff2c282c44596e839e145db0eac536ae16a339.zip
chromium_src-5bff2c282c44596e839e145db0eac536ae16a339.tar.gz
chromium_src-5bff2c282c44596e839e145db0eac536ae16a339.tar.bz2
Revert 238143 "Merge 237646 "Ensure that the OSK on Windows 8 sh..."
> Merge 237646 "Ensure that the OSK on Windows 8 shows up when we ..." > > > Ensure that the OSK on Windows 8 shows up when we tap on an editable field in any WebContents. > > > > The current implementation was displaying the OSK only when we tapped on a WebContents hosted by a Browser window. This > > relied on the ChromeRenderViewObserver object in the renderer sending an IPC message ChromeViewHostMsg_FocusedNodeTouched > > which is handled by the Chrome browser code via a WebContentsObserver implementation. > > > > Based on discussions with jam and comments from avi in the review, we decided to implement this functionality in content. > > > > Fixes are as below:- > > 1. We have a new IPc message ViewHostMsg_FocusedNodeTouched which is defined in the view_messages.h file. > > 2. This IPC is sent by the RenderViewImpl::didHandleGestureEvent method if we tapped on an editable field. > > 3, This IPC is handled by the RenderViewHostImpl class. We display the OSK on Windows 8 Aura if a focused editable > > node was tapped. > > 4. The ChromeViewHostMsg_FocusedNodeTouched IPC has been deleted along with the didHandleGestureEvent method in the > > RenderViewObserver interface. > > > > BUG=321576, 319219 > > R=jam@chromium.org, palmer@chromium.org, jam > > TBR=jschuh > > > > Review URL: https://codereview.chromium.org/89873002 > > TBR=ananta@chromium.org > > Review URL: https://codereview.chromium.org/99843002 TBR=cpu@chromium.org Review URL: https://codereview.chromium.org/99953002 git-svn-id: svn://svn.chromium.org/chrome/branches/1700/src@238153 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/tab_contents/core_tab_helper.cc16
-rw-r--r--chrome/browser/ui/tab_contents/core_tab_helper.h1
-rw-r--r--chrome/common/render_messages.h6
-rw-r--r--chrome/renderer/chrome_render_view_observer.cc13
-rw-r--r--chrome/renderer/chrome_render_view_observer.h2
-rw-r--r--content/browser/renderer_host/render_view_host_impl.cc13
-rw-r--r--content/browser/renderer_host/render_view_host_impl.h1
-rw-r--r--content/common/view_messages.h6
-rw-r--r--content/public/renderer/render_view_observer.h1
-rw-r--r--content/renderer/render_view_impl.cc11
10 files changed, 41 insertions, 29 deletions
diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.cc b/chrome/browser/ui/tab_contents/core_tab_helper.cc
index e0d59bf..f543139 100644
--- a/chrome/browser/ui/tab_contents/core_tab_helper.cc
+++ b/chrome/browser/ui/tab_contents/core_tab_helper.cc
@@ -31,6 +31,10 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/codec/jpeg_codec.h"
+#if defined(OS_WIN)
+#include "base/win/win_util.h"
+#endif
+
using content::WebContents;
DEFINE_WEB_CONTENTS_USER_DATA_KEY(CoreTabHelper);
@@ -191,6 +195,8 @@ void CoreTabHelper::BeforeUnloadDialogCancelled() {
bool CoreTabHelper::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(CoreTabHelper, message)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_FocusedNodeTouched,
+ OnFocusedNodeTouched)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RequestThumbnailForContextNode_ACK,
OnRequestThumbnailForContextNodeACK)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -198,6 +204,16 @@ bool CoreTabHelper::OnMessageReceived(const IPC::Message& message) {
return handled;
}
+void CoreTabHelper::OnFocusedNodeTouched(bool editable) {
+#if defined(OS_WIN) && defined(USE_AURA)
+ if (editable) {
+ base::win::DisplayVirtualKeyboard();
+ } else {
+ base::win::DismissVirtualKeyboard();
+ }
+#endif // OS_WIN && USE_AURA
+}
+
// Handles the image thumbnail for the context node, composes a image search
// request based on the received thumbnail and opens the request in a new tab.
void CoreTabHelper::OnRequestThumbnailForContextNodeACK(
diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.h b/chrome/browser/ui/tab_contents/core_tab_helper.h
index 767c1fe..bb57f4e 100644
--- a/chrome/browser/ui/tab_contents/core_tab_helper.h
+++ b/chrome/browser/ui/tab_contents/core_tab_helper.h
@@ -65,6 +65,7 @@ class CoreTabHelper : public content::WebContentsObserver,
virtual void BeforeUnloadDialogCancelled() OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ void OnFocusedNodeTouched(bool editable);
void OnRequestThumbnailForContextNodeACK(const SkBitmap& bitmap,
const gfx::Size& original_size);
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 3810214..e1b2117 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -666,6 +666,12 @@ IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_DidRetrieveWebappInformation,
GURL /* expected_url */)
#endif // defined(OS_ANDROID)
+// Message sent from renderer to the browser when the element that is focused
+// has been touched. A bool is passed in this message which indicates if the
+// node is editable.
+IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_FocusedNodeTouched,
+ bool /* editable */)
+
// The currently displayed PDF has an unsupported feature.
IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_PDFHasUnsupportedFeature)
diff --git a/chrome/renderer/chrome_render_view_observer.cc b/chrome/renderer/chrome_render_view_observer.cc
index 32944b8..239af55 100644
--- a/chrome/renderer/chrome_render_view_observer.cc
+++ b/chrome/renderer/chrome_render_view_observer.cc
@@ -831,6 +831,19 @@ void ChromeRenderViewObserver::DidClearWindowObject(WebFrame* frame) {
}
}
+void ChromeRenderViewObserver::DidHandleGestureEvent(
+ const WebGestureEvent& event) {
+ if (event.type != WebKit::WebGestureEvent::GestureTap)
+ return;
+
+ WebKit::WebTextInputType text_input_type =
+ render_view()->GetWebView()->textInputInfo().type;
+
+ render_view()->Send(new ChromeViewHostMsg_FocusedNodeTouched(
+ routing_id(),
+ text_input_type != WebKit::WebTextInputTypeNone));
+}
+
void ChromeRenderViewObserver::DetailedConsoleMessageAdded(
const base::string16& message,
const base::string16& source,
diff --git a/chrome/renderer/chrome_render_view_observer.h b/chrome/renderer/chrome_render_view_observer.h
index 0c7d5c50..d60d1b1 100644
--- a/chrome/renderer/chrome_render_view_observer.h
+++ b/chrome/renderer/chrome_render_view_observer.h
@@ -72,6 +72,8 @@ class ChromeRenderViewObserver : public content::RenderViewObserver,
virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame,
bool is_new_navigation) OVERRIDE;
virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE;
+ virtual void DidHandleGestureEvent(
+ const WebKit::WebGestureEvent& event) OVERRIDE;
virtual void DetailedConsoleMessageAdded(const base::string16& message,
const base::string16& source,
const base::string16& stack_trace,
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 0912144..0b1f7c6 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -83,8 +83,6 @@
#include "content/browser/renderer_host/popup_menu_helper_mac.h"
#elif defined(OS_ANDROID)
#include "content/browser/media/android/browser_media_player_manager.h"
-#elif defined(OS_WIN)
-#include "base/win/win_util.h"
#endif
using base::TimeDelta;
@@ -1229,7 +1227,6 @@ bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_DomOperationResponse,
OnDomOperationResponse)
IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents)
- IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched)
// Have the super handle all other messages.
IPC_MESSAGE_UNHANDLED(
handled = RenderWidgetHostImpl::OnMessageReceived(msg))
@@ -2201,16 +2198,6 @@ void RenderViewHostImpl::OnDomOperationResponse(
Details<DomOperationNotificationDetails>(&details));
}
-void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) {
-#if defined(OS_WIN) && defined(USE_AURA)
- if (editable) {
- base::win::DisplayVirtualKeyboard();
- } else {
- base::win::DismissVirtualKeyboard();
- }
-#endif
-}
-
#if defined(OS_MACOSX) || defined(OS_ANDROID)
void RenderViewHostImpl::OnShowPopup(
const ViewHostMsg_ShowPopup_Params& params) {
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
index d63bae3..a3401c3 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -585,7 +585,6 @@ class CONTENT_EXPORT RenderViewHostImpl
void OnDidAccessInitialDocument();
void OnDomOperationResponse(const std::string& json_string,
int automation_id);
- void OnFocusedNodeTouched(bool editable);
#if defined(OS_MACOSX) || defined(OS_ANDROID)
void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params);
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 0a2ecb9..356d33f 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -2264,12 +2264,6 @@ IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateFaviconURL,
IPC_MESSAGE_ROUTED1(ViewHostMsg_DidFirstVisuallyNonEmptyPaint,
int /* page_id */)
-// Message sent from renderer to the browser when the element that is focused
-// has been touched. A bool is passed in this message which indicates if the
-// node is editable.
-IPC_MESSAGE_ROUTED1(ViewHostMsg_FocusedNodeTouched,
- bool /* editable */)
-
#if defined(OS_ANDROID)
// Response to ViewMsg_FindMatchRects.
//
diff --git a/content/public/renderer/render_view_observer.h b/content/public/renderer/render_view_observer.h
index 87ee60f..d4ad79a 100644
--- a/content/public/renderer/render_view_observer.h
+++ b/content/public/renderer/render_view_observer.h
@@ -94,6 +94,7 @@ class CONTENT_EXPORT RenderViewObserver : public IPC::Listener,
// These match the RenderView methods.
virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) {}
virtual void DidHandleTouchEvent(const WebKit::WebTouchEvent& event) {}
+ virtual void DidHandleGestureEvent(const WebKit::WebGestureEvent& event) {}
virtual void DidCreatePepperPlugin(RendererPpapiHost* host) {}
// Called when we receive a console message from WebKit for which we requested
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 33e79bc..8a62e94 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3055,15 +3055,8 @@ void RenderViewImpl::didHandleGestureEvent(
const WebGestureEvent& event,
bool event_cancelled) {
RenderWidget::didHandleGestureEvent(event, event_cancelled);
-
- if (event.type != blink::WebGestureEvent::GestureTap)
- return;
-
- blink::WebTextInputType text_input_type =
- GetWebView()->textInputInfo().type;
-
- Send(new ViewHostMsg_FocusedNodeTouched(
- routing_id(), text_input_type != blink::WebTextInputTypeNone));
+ FOR_EACH_OBSERVER(RenderViewObserver, observers_,
+ DidHandleGestureEvent(event));
}
void RenderViewImpl::initializeLayerTreeView() {