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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 332 |
333 void RenderWidgetHostViewAura::Hide() { | 333 void RenderWidgetHostViewAura::Hide() { |
334 window_->Hide(); | 334 window_->Hide(); |
335 } | 335 } |
336 | 336 |
337 bool RenderWidgetHostViewAura::IsShowing() { | 337 bool RenderWidgetHostViewAura::IsShowing() { |
338 return window_->IsVisible(); | 338 return window_->IsVisible(); |
339 } | 339 } |
340 | 340 |
341 gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { | 341 gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { |
342 return window_->GetRootWindowBounds(); | 342 return window_->GetBoundsInRootWindow(); |
343 } | 343 } |
344 | 344 |
345 void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) { | 345 void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) { |
346 current_cursor_ = cursor; | 346 current_cursor_ = cursor; |
347 const gfx::Display display = gfx::Screen::GetDisplayNearestWindow(window_); | 347 const gfx::Display display = gfx::Screen::GetDisplayNearestWindow(window_); |
348 current_cursor_.SetScaleFactor(display.device_scale_factor()); | 348 current_cursor_.SetScaleFactor(display.device_scale_factor()); |
349 UpdateCursorIfOverSelf(); | 349 UpdateCursorIfOverSelf(); |
350 } | 350 } |
351 | 351 |
352 void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) { | 352 void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) { |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 void RenderWidgetHostViewAura::SetBackground(const SkBitmap& background) { | 692 void RenderWidgetHostViewAura::SetBackground(const SkBitmap& background) { |
693 content::RenderWidgetHostViewBase::SetBackground(background); | 693 content::RenderWidgetHostViewBase::SetBackground(background); |
694 host_->SetBackground(background); | 694 host_->SetBackground(background); |
695 window_->layer()->SetFillsBoundsOpaquely(background.isOpaque()); | 695 window_->layer()->SetFillsBoundsOpaquely(background.isOpaque()); |
696 } | 696 } |
697 | 697 |
698 void RenderWidgetHostViewAura::GetScreenInfo(WebKit::WebScreenInfo* results) { | 698 void RenderWidgetHostViewAura::GetScreenInfo(WebKit::WebScreenInfo* results) { |
699 GetScreenInfoForWindow(results, window_); | 699 GetScreenInfoForWindow(results, window_); |
700 } | 700 } |
701 | 701 |
702 gfx::Rect RenderWidgetHostViewAura::GetRootWindowBounds() { | 702 gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() { |
703 return window_->GetToplevelWindow()->bounds(); | 703 return window_->GetToplevelWindow()->GetBoundsInRootWindow(); |
704 } | 704 } |
705 | 705 |
706 void RenderWidgetHostViewAura::ProcessTouchAck( | 706 void RenderWidgetHostViewAura::ProcessTouchAck( |
707 WebKit::WebInputEvent::Type type, bool processed) { | 707 WebKit::WebInputEvent::Type type, bool processed) { |
708 // The ACKs for the touch-events arrive in the same sequence as they were | 708 // The ACKs for the touch-events arrive in the same sequence as they were |
709 // dispatched. | 709 // dispatched. |
710 aura::RootWindow* root_window = window_->GetRootWindow(); | 710 aura::RootWindow* root_window = window_->GetRootWindow(); |
711 if (root_window) | 711 if (root_window) |
712 root_window->AdvanceQueuedTouchEvent(window_, processed); | 712 root_window->AdvanceQueuedTouchEvent(window_, processed); |
713 } | 713 } |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( | 1471 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( |
1472 RenderWidgetHost* widget) { | 1472 RenderWidgetHost* widget) { |
1473 return new RenderWidgetHostViewAura(widget); | 1473 return new RenderWidgetHostViewAura(widget); |
1474 } | 1474 } |
1475 | 1475 |
1476 // static | 1476 // static |
1477 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 1477 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
1478 WebKit::WebScreenInfo* results) { | 1478 WebKit::WebScreenInfo* results) { |
1479 GetScreenInfoForWindow(results, NULL); | 1479 GetScreenInfoForWindow(results, NULL); |
1480 } | 1480 } |
OLD | NEW |