OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 7 #include "base/logging.h" |
8 #include "content/browser/renderer_host/backing_store_skia.h" | 8 #include "content/browser/renderer_host/backing_store_skia.h" |
9 #include "content/browser/renderer_host/render_widget_host.h" | 9 #include "content/browser/renderer_host/render_widget_host.h" |
10 #include "content/browser/renderer_host/web_input_event_aura.h" | 10 #include "content/browser/renderer_host/web_input_event_aura.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 207 |
208 void RenderWidgetHostViewAura::Hide() { | 208 void RenderWidgetHostViewAura::Hide() { |
209 window_->Hide(); | 209 window_->Hide(); |
210 } | 210 } |
211 | 211 |
212 bool RenderWidgetHostViewAura::IsShowing() { | 212 bool RenderWidgetHostViewAura::IsShowing() { |
213 return window_->IsVisible(); | 213 return window_->IsVisible(); |
214 } | 214 } |
215 | 215 |
216 gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { | 216 gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { |
217 return window_->bounds(); | 217 return window_->GetScreenBounds(); |
218 } | 218 } |
219 | 219 |
220 void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) { | 220 void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) { |
221 current_cursor_ = cursor; | 221 current_cursor_ = cursor; |
222 UpdateCursorIfOverSelf(); | 222 UpdateCursorIfOverSelf(); |
223 } | 223 } |
224 | 224 |
225 void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) { | 225 void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) { |
226 is_loading_ = is_loading; | 226 is_loading_ = is_loading; |
227 UpdateCursorIfOverSelf(); | 227 UpdateCursorIfOverSelf(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 #endif | 325 #endif |
326 | 326 |
327 void RenderWidgetHostViewAura::SetBackground(const SkBitmap& background) { | 327 void RenderWidgetHostViewAura::SetBackground(const SkBitmap& background) { |
328 RenderWidgetHostView::SetBackground(background); | 328 RenderWidgetHostView::SetBackground(background); |
329 host_->SetBackground(background); | 329 host_->SetBackground(background); |
330 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 330 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
331 window_->layer()->SetFillsBoundsOpaquely(background.isOpaque()); | 331 window_->layer()->SetFillsBoundsOpaquely(background.isOpaque()); |
332 #endif | 332 #endif |
333 } | 333 } |
334 | 334 |
335 #if defined(OS_POSIX) | |
336 void RenderWidgetHostViewAura::GetDefaultScreenInfo( | 335 void RenderWidgetHostViewAura::GetDefaultScreenInfo( |
337 WebKit::WebScreenInfo* results) { | 336 WebKit::WebScreenInfo* results) { |
338 GetScreenInfo(results); | 337 GetScreenInfo(results); |
339 } | 338 } |
340 | 339 |
341 void RenderWidgetHostViewAura::GetScreenInfo(WebKit::WebScreenInfo* results) { | 340 void RenderWidgetHostViewAura::GetScreenInfo(WebKit::WebScreenInfo* results) { |
342 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); | 341 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); |
343 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); | 342 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); |
344 results->availableRect = results->rect; | 343 results->availableRect = results->rect; |
345 // TODO(derat): Don't hardcode this? | 344 // TODO(derat): Don't hardcode this? |
346 results->depth = 24; | 345 results->depth = 24; |
347 results->depthPerComponent = 8; | 346 results->depthPerComponent = 8; |
348 } | 347 } |
349 | 348 |
350 gfx::Rect RenderWidgetHostViewAura::GetRootWindowBounds() { | 349 gfx::Rect RenderWidgetHostViewAura::GetRootWindowBounds() { |
351 return aura::Desktop::GetInstance()->bounds(); | 350 // TODO(beng): this is actually wrong, we are supposed to return the bounds |
| 351 // of the container "top level" window, but we don't have a firm |
| 352 // concept of what constitutes a toplevel right now, so just do |
| 353 // this. |
| 354 return window_->GetScreenBounds(); |
352 } | 355 } |
353 #endif | |
354 | 356 |
355 void RenderWidgetHostViewAura::SetVisuallyDeemphasized(const SkColor* color, | 357 void RenderWidgetHostViewAura::SetVisuallyDeemphasized(const SkColor* color, |
356 bool animate) { | 358 bool animate) { |
357 // http://crbug.com/102568 | 359 // http://crbug.com/102568 |
358 NOTIMPLEMENTED(); | 360 NOTIMPLEMENTED(); |
359 } | 361 } |
360 | 362 |
361 void RenderWidgetHostViewAura::UnhandledWheelEvent( | 363 void RenderWidgetHostViewAura::UnhandledWheelEvent( |
362 const WebKit::WebMouseWheelEvent& event) { | 364 const WebKit::WebMouseWheelEvent& event) { |
363 // Not needed. Mac-only. | 365 // Not needed. Mac-only. |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 aura::Desktop* desktop = aura::Desktop::GetInstance(); | 536 aura::Desktop* desktop = aura::Desktop::GetInstance(); |
535 if (desktop->GetEventHandlerForPoint(screen_point) != window_) | 537 if (desktop->GetEventHandlerForPoint(screen_point) != window_) |
536 return; | 538 return; |
537 | 539 |
538 gfx::NativeCursor cursor = current_cursor_.GetNativeCursor(); | 540 gfx::NativeCursor cursor = current_cursor_.GetNativeCursor(); |
539 if (is_loading_ && cursor == aura::kCursorPointer) | 541 if (is_loading_ && cursor == aura::kCursorPointer) |
540 cursor = aura::kCursorProgress; | 542 cursor = aura::kCursorProgress; |
541 | 543 |
542 aura::Desktop::GetInstance()->SetCursor(cursor); | 544 aura::Desktop::GetInstance()->SetCursor(cursor); |
543 } | 545 } |
OLD | NEW |