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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 195793004: Implement overscroll support for the virtual keyboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unittest. Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 else 868 else
869 return bounds; 869 return bounds;
870 } 870 }
871 871
872 void RenderWidgetHostViewAura::SetBackground(const SkBitmap& background) { 872 void RenderWidgetHostViewAura::SetBackground(const SkBitmap& background) {
873 RenderWidgetHostViewBase::SetBackground(background); 873 RenderWidgetHostViewBase::SetBackground(background);
874 host_->SetBackground(background); 874 host_->SetBackground(background);
875 window_->layer()->SetFillsBoundsOpaquely(background.isOpaque()); 875 window_->layer()->SetFillsBoundsOpaquely(background.isOpaque());
876 } 876 }
877 877
878 gfx::Size RenderWidgetHostViewAura::GetVisibleViewportSize() const {
879 gfx::Rect window_bounds = window_->GetBoundsInScreen();
sky 2014/04/24 19:15:01 GetBoundsInScreen()->bounds()
kevers 2014/04/24 20:09:00 Done.
880 int viewport_width = window_bounds.width() - insets_.left() - insets_.right();
sky 2014/04/24 19:15:01 std::max(0, ...) for both of these lines?
kevers 2014/04/24 20:09:00 Done.
881 int viewport_height = window_bounds.height() - insets_.top() -
882 insets_.bottom();
883 return gfx::Size(viewport_width, viewport_height);
884 }
885
886 void RenderWidgetHostViewAura::SetInsets(const gfx::Insets& insets) {
887 if (insets != insets_) {
888 insets_ = insets;
889 host_->WasResized();
890 }
891 }
892
878 void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) { 893 void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) {
879 current_cursor_ = cursor; 894 current_cursor_ = cursor;
880 const gfx::Display display = gfx::Screen::GetScreenFor(window_)-> 895 const gfx::Display display = gfx::Screen::GetScreenFor(window_)->
881 GetDisplayNearestWindow(window_); 896 GetDisplayNearestWindow(window_);
882 current_cursor_.SetDisplayInfo(display); 897 current_cursor_.SetDisplayInfo(display);
883 UpdateCursorIfOverSelf(); 898 UpdateCursorIfOverSelf();
884 } 899 }
885 900
886 void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) { 901 void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) {
887 is_loading_ = is_loading; 902 is_loading_ = is_loading;
(...skipping 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after
3170 RenderWidgetHost* widget) { 3185 RenderWidgetHost* widget) {
3171 return new RenderWidgetHostViewAura(widget); 3186 return new RenderWidgetHostViewAura(widget);
3172 } 3187 }
3173 3188
3174 // static 3189 // static
3175 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3190 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3176 GetScreenInfoForWindow(results, NULL); 3191 GetScreenInfoForWindow(results, NULL);
3177 } 3192 }
3178 3193
3179 } // namespace content 3194 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698