OLD | NEW |
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 Loading... |
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_->bounds(); |
| 880 int viewport_width = std::max( |
| 881 0, window_bounds.width() - insets_.left() - insets_.right()); |
| 882 int viewport_height = std::max( |
| 883 0, window_bounds.height() - insets_.top() - insets_.bottom()); |
| 884 return gfx::Size(viewport_width, viewport_height); |
| 885 } |
| 886 |
| 887 void RenderWidgetHostViewAura::SetInsets(const gfx::Insets& insets) { |
| 888 if (insets != insets_) { |
| 889 insets_ = insets; |
| 890 host_->WasResized(); |
| 891 } |
| 892 } |
| 893 |
878 void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) { | 894 void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) { |
879 current_cursor_ = cursor; | 895 current_cursor_ = cursor; |
880 const gfx::Display display = gfx::Screen::GetScreenFor(window_)-> | 896 const gfx::Display display = gfx::Screen::GetScreenFor(window_)-> |
881 GetDisplayNearestWindow(window_); | 897 GetDisplayNearestWindow(window_); |
882 current_cursor_.SetDisplayInfo(display); | 898 current_cursor_.SetDisplayInfo(display); |
883 UpdateCursorIfOverSelf(); | 899 UpdateCursorIfOverSelf(); |
884 } | 900 } |
885 | 901 |
886 void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) { | 902 void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) { |
887 is_loading_ = is_loading; | 903 is_loading_ = is_loading; |
(...skipping 2285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3173 RenderWidgetHost* widget) { | 3189 RenderWidgetHost* widget) { |
3174 return new RenderWidgetHostViewAura(widget); | 3190 return new RenderWidgetHostViewAura(widget); |
3175 } | 3191 } |
3176 | 3192 |
3177 // static | 3193 // static |
3178 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3194 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
3179 GetScreenInfoForWindow(results, NULL); | 3195 GetScreenInfoForWindow(results, NULL); |
3180 } | 3196 } |
3181 | 3197 |
3182 } // namespace content | 3198 } // namespace content |
OLD | NEW |