summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
authormazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-28 00:31:21 +0000
committermazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-28 00:31:21 +0000
commitad0783f91c1436785e7de77dbfd8e78fed2d2c9f (patch)
treeb0d35aeb499082a1cb5442282d3aa5f47d7a6061 /chrome/browser/ui
parentf2fa809160bae2805090f57b76dc64893f87ceb1 (diff)
downloadchromium_src-ad0783f91c1436785e7de77dbfd8e78fed2d2c9f.zip
chromium_src-ad0783f91c1436785e7de77dbfd8e78fed2d2c9f.tar.gz
chromium_src-ad0783f91c1436785e7de77dbfd8e78fed2d2c9f.tar.bz2
Always show keyboard when an editable element is touched.
BUG=none TEST=manually Review URL: http://codereview.chromium.org/7244002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90684 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/touch/frame/touch_browser_frame_view.cc5
-rw-r--r--chrome/browser/ui/views/frame/browser_root_view.cc26
-rw-r--r--chrome/browser/ui/views/frame/browser_root_view.h6
3 files changed, 37 insertions, 0 deletions
diff --git a/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc b/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
index 29aed09..d2c3c65 100644
--- a/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
+++ b/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
@@ -77,6 +77,9 @@ TouchBrowserFrameView::TouchBrowserFrameView(BrowserFrame* frame,
registrar_.Add(this,
NotificationType::SET_KEYBOARD_HEIGHT_INVOKED,
NotificationService::AllSources());
+ registrar_.Add(this,
+ NotificationType::EDITABLE_ELEMENT_TOUCHED,
+ NotificationService::AllSources());
browser_view->browser()->tabstrip_model()->AddObserver(this);
@@ -321,6 +324,8 @@ void TouchBrowserFrameView::Observe(NotificationType type,
keyboard_height_ = height;
parent()->Layout();
}
+ } else if (type == NotificationType::EDITABLE_ELEMENT_TOUCHED) {
+ UpdateKeyboardAndLayout(true);
}
}
diff --git a/chrome/browser/ui/views/frame/browser_root_view.cc b/chrome/browser/ui/views/frame/browser_root_view.cc
index 64a03f1..d1d07f3 100644
--- a/chrome/browser/ui/views/frame/browser_root_view.cc
+++ b/chrome/browser/ui/views/frame/browser_root_view.cc
@@ -18,6 +18,11 @@
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/l10n/l10n_util.h"
+#if defined(TOUCH_UI)
+#include "content/common/notification_service.h"
+#include "content/common/notification_type.h"
+#include "views/ime/text_input_client.h"
+#endif
// static
const char BrowserRootView::kViewClassName[] =
@@ -29,6 +34,27 @@ BrowserRootView::BrowserRootView(BrowserView* browser_view,
browser_view_(browser_view),
forwarding_to_tab_strip_(false) { }
+#if defined(TOUCH_UI)
+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)
+ return status;
+ views::TextInputClient* text_input_client = handler->GetTextInputClient();
+ if (!text_input_client)
+ return status;
+ ui::TextInputType text_input_type = text_input_client->GetTextInputType();
+ if (text_input_type != ui::TEXT_INPUT_TYPE_NONE) {
+ NotificationService::current()->Notify(
+ NotificationType::EDITABLE_ELEMENT_TOUCHED,
+ Source<View>(this),
+ Details<ui::TextInputType>(&text_input_type));
+ }
+ return status;
+}
+#endif
+
bool BrowserRootView::GetDropFormats(
int* formats,
std::set<ui::OSExchangeData::CustomFormat>* custom_formats) {
diff --git a/chrome/browser/ui/views/frame/browser_root_view.h b/chrome/browser/ui/views/frame/browser_root_view.h
index c1f3d77..46382a0 100644
--- a/chrome/browser/ui/views/frame/browser_root_view.h
+++ b/chrome/browser/ui/views/frame/browser_root_view.h
@@ -13,6 +13,9 @@ class BrowserView;
namespace ui {
class OSExchangeData;
+#if defined(TOUCH_UI)
+enum TouchStatus;
+#endif
}
// RootView implementation used by BrowserFrame. This forwards drop events to
@@ -29,6 +32,9 @@ class BrowserRootView : public views::internal::RootView {
BrowserRootView(BrowserView* browser_view, views::Widget* widget);
// Overridden from views::View:
+#if defined(TOUCH_UI)
+ virtual ui::TouchStatus OnTouchEvent(const views::TouchEvent& event) OVERRIDE;
+#endif
virtual bool GetDropFormats(
int* formats,
std::set<ui::OSExchangeData::CustomFormat>* custom_formats) OVERRIDE;