Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 826713002: [ChromeOS] Show autofill popup after keyboard (if any) is shown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable autofill popup waiting for keyboard when keyboard has been disabled. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/input_method/textinput_test_helper.cc ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 54d70c0c4b859ed2278a0f9a32b22437f2615a07..cf9232fd4d79aa3baaa48033ab8387f3c3695d9e 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -62,6 +62,7 @@
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#include "ui/base/hit_test.h"
#include "ui/base/ime/input_method.h"
+#include "ui/base/ime/input_method_observer.h"
#include "ui/base/ui_base_types.h"
#include "ui/compositor/compositor_vsync_manager.h"
#include "ui/compositor/dip_util.h"
@@ -324,6 +325,36 @@ bool PointerEventActivates(const ui::Event& event) {
return false;
}
+class KeyboardBoundsUnchangedListener : public ui::InputMethodObserver {
+ public:
+ KeyboardBoundsUnchangedListener(ui::InputMethod* input_method,
+ RenderWidgetHostImpl* host)
+ : host_(host) {
+ input_method->AddObserver(this);
+ }
+
+ private:
+ ~KeyboardBoundsUnchangedListener() override {}
+
+ // Overridden from ui::InputMethodObserver:
+ void OnTextInputTypeChanged(const ui::TextInputClient* client) override {}
+ void OnFocus() override {}
+ void OnBlur() override {}
+ void OnCaretBoundsChanged(const ui::TextInputClient* client) override {}
+ void OnTextInputStateChanged(const ui::TextInputClient* client) override {}
+ void OnInputMethodDestroyed(const ui::InputMethod* input_method) override {
+ delete this;
+ }
+ void OnShowImeIfNeeded() override {}
+ void OnKeyboardBoundsUnchanged() override {
+ host_->Send(new ViewMsg_FocusChangeComplete(host_->GetRoutingID()));
+ }
+
+ RenderWidgetHostImpl* const host_;
+
+ DISALLOW_COPY_AND_ASSIGN(KeyboardBoundsUnchangedListener);
+};
+
} // namespace
// We need to watch for mouse events outside a Web Popup or its parent
@@ -453,6 +484,9 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host,
bool overscroll_enabled = base::CommandLine::ForCurrentProcess()->
GetSwitchValueASCII(switches::kOverscrollHistoryNavigation) != "0";
SetOverscrollControllerEnabled(overscroll_enabled);
+
+ if (GetInputMethod())
+ new KeyboardBoundsUnchangedListener(GetInputMethod(), host_);
}
////////////////////////////////////////////////////////////////////////////////
@@ -866,6 +900,9 @@ void RenderWidgetHostViewAura::OnTextInputStateChanged(
if (GetInputMethod())
GetInputMethod()->ShowImeIfNeeded();
}
+
+ if (!GetInputMethod() || !GetInputMethod()->SupportsOnScreenKeyboard())
+ host_->Send(new ViewMsg_FocusChangeComplete(host_->GetRoutingID()));
}
void RenderWidgetHostViewAura::ImeCancelComposition() {
« no previous file with comments | « chrome/browser/chromeos/input_method/textinput_test_helper.cc ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698