Commit a9f090b9 authored by mazda@chromium.org's avatar mazda@chromium.org

Fix the bug of the hide key on Omnibox.

Fix a bug of hide key where the keyboard does now show up after the hide key is
pressed while Omnibox has the focus and Omnibox is touched.
I changed the way of retrieving the text input type to use
InputMethod::GetTextInputType rather than TextInputClient::GetTextInputType
because NULL is always set to touch_pressed_handler when omnibox is touched.
I also added code to check the touch event type so that the notification is sent
only when text element is touched.

BUG=none
TEST=manually


Review URL: http://codereview.chromium.org/7324029

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91854 0039d316-1c4b-4281-b951-d872f2087c98
parent cda29aaf
......@@ -21,7 +21,7 @@
#if defined(TOUCH_UI)
#include "content/common/notification_service.h"
#include "content/common/notification_type.h"
#include "views/ime/text_input_client.h"
#include "views/ime/input_method.h"
#endif
// static
......@@ -38,13 +38,14 @@ BrowserRootView::BrowserRootView(BrowserView* browser_view,
ui::TouchStatus BrowserRootView::OnTouchEvent(const views::TouchEvent& event) {
const ui::TouchStatus status = views::internal::RootView::OnTouchEvent(event);
views::View* handler = touch_pressed_handler();
if (!handler)
if (event.type() != ui::ET_TOUCH_PRESSED)
return status;
views::TextInputClient* text_input_client = handler->GetTextInputClient();
if (!text_input_client)
views::InputMethod* input_method = GetInputMethod();
if (!input_method)
return status;
ui::TextInputType text_input_type = text_input_client->GetTextInputType();
ui::TextInputType text_input_type = input_method->GetTextInputType();
if (text_input_type != ui::TEXT_INPUT_TYPE_NONE) {
NotificationService::current()->Notify(
NotificationType::EDITABLE_ELEMENT_TOUCHED,
......
......@@ -127,8 +127,6 @@ class RootView : public View,
virtual void CalculateOffsetToAncestorWithLayer(gfx::Point* offset,
View** ancestor) OVERRIDE;
View* touch_pressed_handler() const { return touch_pressed_handler_; }
private:
friend class View;
friend class Widget;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment