Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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.h" | 5 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 6 | 6 |
| 7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
| 8 #include "third_party/WebKit/Source/WebKit/chromium/public/mac/WebScreenInfoFact ory.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/mac/WebScreenInfoFact ory.h" |
| 9 | 9 |
| 10 #if defined(TOUCH_UI) | |
| 11 #include <gdk/gdkx.h> | |
| 12 #include <gtk/gtk.h> | |
| 13 #endif | |
| 14 | |
| 10 // TODO(jam): move this to render_widget_host_view_mac.mm when it moves to | 15 // TODO(jam): move this to render_widget_host_view_mac.mm when it moves to |
| 11 // content. | 16 // content. |
| 12 #if defined(OS_MACOSX) | 17 #if defined(OS_MACOSX) |
| 13 // static | 18 // static |
| 14 void RenderWidgetHostView::GetDefaultScreenInfo( | 19 void RenderWidgetHostView::GetDefaultScreenInfo( |
| 15 WebKit::WebScreenInfo* results) { | 20 WebKit::WebScreenInfo* results) { |
| 16 *results = WebKit::WebScreenInfoFactory::screenInfo(NULL); | 21 *results = WebKit::WebScreenInfoFactory::screenInfo(NULL); |
| 17 } | 22 } |
| 18 #endif | 23 #endif |
| 19 | 24 |
| 25 // TODO(erg): move this to render_widget_host_view_views_gtk.cc when if it | |
|
jam
2011/08/25 23:13:54
this would be the 3d copy of this code :)
see the
| |
| 26 // moves to content. | |
| 27 #if defined(TOUCH_UI) | |
| 28 | |
| 29 namespace { | |
| 30 | |
| 31 // This was copied from render_widget_host_view_views_gtk.cc to make this link; | |
| 32 // it is already copied (again) from RenderWidgetHostViewGtk. | |
| 33 void GetScreenInfoFromNativeWindow( | |
| 34 GdkWindow* gdk_window, WebKit::WebScreenInfo* results) { | |
| 35 GdkScreen* screen = gdk_drawable_get_screen(gdk_window); | |
| 36 *results = WebKit::WebScreenInfoFactory::screenInfo( | |
| 37 gdk_x11_drawable_get_xdisplay(gdk_window), | |
| 38 gdk_x11_screen_get_screen_number(screen)); | |
| 39 | |
| 40 // TODO(tony): We should move this code into WebScreenInfoFactory. | |
| 41 int monitor_number = gdk_screen_get_monitor_at_window(screen, gdk_window); | |
| 42 GdkRectangle monitor_rect; | |
| 43 gdk_screen_get_monitor_geometry(screen, monitor_number, &monitor_rect); | |
| 44 results->rect = WebKit::WebRect(monitor_rect.x, monitor_rect.y, | |
| 45 monitor_rect.width, monitor_rect.height); | |
| 46 // TODO(tony): Should we query _NET_WORKAREA to get the workarea? | |
| 47 results->availableRect = results->rect; | |
| 48 } | |
| 49 | |
| 50 } // namespace | |
| 51 | |
| 52 // static | |
| 53 void RenderWidgetHostView::GetDefaultScreenInfo( | |
| 54 WebKit::WebScreenInfo* results) { | |
| 55 GdkWindow* gdk_window = | |
| 56 gdk_display_get_default_group(gdk_display_get_default()); | |
| 57 GetScreenInfoFromNativeWindow(gdk_window, results); | |
| 58 } | |
| 59 #endif | |
| 60 | |
| 20 RenderWidgetHostView::~RenderWidgetHostView() {} | 61 RenderWidgetHostView::~RenderWidgetHostView() {} |
| 21 | 62 |
| 22 void RenderWidgetHostView::SetBackground(const SkBitmap& background) { | 63 void RenderWidgetHostView::SetBackground(const SkBitmap& background) { |
| 23 background_ = background; | 64 background_ = background; |
| 24 } | 65 } |
| OLD | NEW |