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

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

Issue 8566011: Completes the GetWindowRect/GetRootWindowRect/GetScreenInfo changes I thought I had finished with... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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) 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void RenderWidgetHostViewAura::GetDefaultScreenInfo(
336 WebKit::WebScreenInfo* results) {
337 GetScreenInfo(results);
338 }
339
340 void RenderWidgetHostViewAura::GetScreenInfo(WebKit::WebScreenInfo* results) { 335 void RenderWidgetHostViewAura::GetScreenInfo(WebKit::WebScreenInfo* results) {
341 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); 336 GetDefaultScreenInfo(results);
342 results->rect = WebKit::WebRect(0, 0, size.width(), size.height());
343 results->availableRect = results->rect;
344 // TODO(derat): Don't hardcode this?
345 results->depth = 24;
346 results->depthPerComponent = 8;
347 } 337 }
348 338
349 gfx::Rect RenderWidgetHostViewAura::GetRootWindowBounds() { 339 gfx::Rect RenderWidgetHostViewAura::GetRootWindowBounds() {
350 // TODO(beng): this is actually wrong, we are supposed to return the bounds 340 // 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 341 // 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 342 // concept of what constitutes a toplevel right now, so just do
353 // this. 343 // this.
354 return window_->GetScreenBounds(); 344 return window_->GetScreenBounds();
355 } 345 }
356 346
(...skipping 11 matching lines...) Expand all
368 void RenderWidgetHostViewAura::SetHasHorizontalScrollbar( 358 void RenderWidgetHostViewAura::SetHasHorizontalScrollbar(
369 bool has_horizontal_scrollbar) { 359 bool has_horizontal_scrollbar) {
370 // Not needed. Mac-only. 360 // Not needed. Mac-only.
371 } 361 }
372 362
373 void RenderWidgetHostViewAura::SetScrollOffsetPinning( 363 void RenderWidgetHostViewAura::SetScrollOffsetPinning(
374 bool is_pinned_to_left, bool is_pinned_to_right) { 364 bool is_pinned_to_left, bool is_pinned_to_right) {
375 // Not needed. Mac-only. 365 // Not needed. Mac-only.
376 } 366 }
377 367
378 #if defined(OS_WIN)
379 void RenderWidgetHostViewAura::WillWmDestroy() {
380 // Nothing to do.
381 }
382 #endif
383
384 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) 368 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
385 gfx::PluginWindowHandle RenderWidgetHostViewAura::GetCompositingSurface() { 369 gfx::PluginWindowHandle RenderWidgetHostViewAura::GetCompositingSurface() {
386 // The GPU process renders to an offscreen surface (created by the GPU 370 // The GPU process renders to an offscreen surface (created by the GPU
387 // process), which is later displayed by the browser. As the GPU process 371 // process), which is later displayed by the browser. As the GPU process
388 // creates this surface, we can return any non-zero value. 372 // creates this surface, we can return any non-zero value.
389 return 1; 373 return 1;
390 } 374 }
391 #else 375 #else
392 gfx::PluginWindowHandle RenderWidgetHostViewAura::GetCompositingSurface() { 376 gfx::PluginWindowHandle RenderWidgetHostViewAura::GetCompositingSurface() {
393 // TODO(oshima): The original implementation was broken as 377 // TODO(oshima): The original implementation was broken as
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 aura::Desktop* desktop = aura::Desktop::GetInstance(); 520 aura::Desktop* desktop = aura::Desktop::GetInstance();
537 if (desktop->GetEventHandlerForPoint(screen_point) != window_) 521 if (desktop->GetEventHandlerForPoint(screen_point) != window_)
538 return; 522 return;
539 523
540 gfx::NativeCursor cursor = current_cursor_.GetNativeCursor(); 524 gfx::NativeCursor cursor = current_cursor_.GetNativeCursor();
541 if (is_loading_ && cursor == aura::kCursorPointer) 525 if (is_loading_ && cursor == aura::kCursorPointer)
542 cursor = aura::kCursorProgress; 526 cursor = aura::kCursorProgress;
543 527
544 aura::Desktop::GetInstance()->SetCursor(cursor); 528 aura::Desktop::GetInstance()->SetCursor(cursor);
545 } 529 }
530
531 ////////////////////////////////////////////////////////////////////////////////
532 // RenderWidgetHostView, public:
533
534 // static
535 void RenderWidgetHostView::GetDefaultScreenInfo(
536 WebKit::WebScreenInfo* results) {
537 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize();
538 results->rect = WebKit::WebRect(0, 0, size.width(), size.height());
539 results->availableRect = results->rect;
540 // TODO(derat): Don't hardcode this?
541 results->depth = 24;
542 results->depthPerComponent = 8;
543 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698