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

Unified Diff: ui/keyboard/content/keyboard_ui_content.cc

Issue 1323053005: Fix cropped floating gesture candidate window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile Created 5 years, 2 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 | « ui/keyboard/content/keyboard_ui_content.h ('k') | ui/keyboard/keyboard_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/content/keyboard_ui_content.cc
diff --git a/ui/keyboard/content/keyboard_ui_content.cc b/ui/keyboard/content/keyboard_ui_content.cc
index 010abde98003e88e38fa79fea0f57081605a2f81..40952ad7e9ef3ede94b8396eddbb8fb8a6d34652 100644
--- a/ui/keyboard/content/keyboard_ui_content.cc
+++ b/ui/keyboard/content/keyboard_ui_content.cc
@@ -160,6 +160,9 @@ void KeyboardUIContent::LoadSystemKeyboard() {
void KeyboardUIContent::UpdateInsetsForWindow(aura::Window* window) {
aura::Window* keyboard_window = GetKeyboardWindow();
+ if (!ShouldWindowOverscroll(window))
+ return;
+
scoped_ptr<content::RenderWidgetHostIterator> widgets(
content::RenderWidgetHost::GetRenderWidgetHosts());
while (content::RenderWidgetHost* widget = widgets->GetNextHost()) {
@@ -198,6 +201,10 @@ bool KeyboardUIContent::HasKeyboardWindow() const {
return keyboard_contents_;
}
+bool KeyboardUIContent::ShouldWindowOverscroll(aura::Window* window) const {
+ return true;
+}
+
void KeyboardUIContent::ReloadKeyboardIfNeeded() {
DCHECK(keyboard_contents_);
if (keyboard_contents_->GetURL() != GetVirtualKeyboardUrl()) {
@@ -222,19 +229,13 @@ void KeyboardUIContent::InitInsets(const gfx::Rect& new_bounds) {
// window is created while the keyboard is visible.
scoped_ptr<content::RenderWidgetHostIterator> widgets(
content::RenderWidgetHost::GetRenderWidgetHosts());
- aura::Window* keyboard_window = GetKeyboardWindow();
- aura::Window* root_window = keyboard_window->GetRootWindow();
while (content::RenderWidgetHost* widget = widgets->GetNextHost()) {
content::RenderWidgetHostView* view = widget->GetView();
// Can be NULL, e.g. if the RenderWidget is being destroyed or
// the render process crashed.
if (view) {
aura::Window* window = view->GetNativeView();
- // If virtual keyboard failed to load, a widget that displays error
- // message will be created and adds as a child of the virtual keyboard
- // window. We want to avoid add BoundsChangedObserver to that window.
- if (!keyboard_window->Contains(window) &&
- window->GetRootWindow() == root_window) {
+ if (ShouldWindowOverscroll(window)) {
gfx::Rect window_bounds = window->GetBoundsInScreen();
gfx::Rect intersect = gfx::IntersectRects(window_bounds,
new_bounds);
@@ -283,6 +284,13 @@ void KeyboardUIContent::OnWindowDestroyed(aura::Window* window) {
window->RemoveObserver(this);
}
+const aura::Window* KeyboardUIContent::GetKeyboardRootWindow() const {
+ if (!keyboard_contents_) {
+ return nullptr;
+ }
+ return keyboard_contents_->GetNativeView()->GetRootWindow();
+}
+
void KeyboardUIContent::LoadContents(const GURL& url) {
if (keyboard_contents_) {
content::OpenURLParams params(
« no previous file with comments | « ui/keyboard/content/keyboard_ui_content.h ('k') | ui/keyboard/keyboard_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698