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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 default: | 106 default: |
107 break; | 107 break; |
108 } | 108 } |
109 #endif | 109 #endif |
110 return true; | 110 return true; |
111 } | 111 } |
112 | 112 |
113 void GetScreenInfoForWindow(WebKit::WebScreenInfo* results, | 113 void GetScreenInfoForWindow(WebKit::WebScreenInfo* results, |
114 aura::Window* window) { | 114 aura::Window* window) { |
115 const gfx::Display display = window ? | 115 const gfx::Display display = window ? |
116 gfx::Screen::GetMonitorNearestWindow(window) : | 116 gfx::Screen::GetDisplayNearestWindow(window) : |
117 gfx::Screen::GetPrimaryMonitor(); | 117 gfx::Screen::GetPrimaryDisplay(); |
118 const gfx::Size size = display.size(); | 118 const gfx::Size size = display.size(); |
119 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); | 119 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); |
120 results->availableRect = results->rect; | 120 results->availableRect = results->rect; |
121 // TODO(derat|oshima): Don't hardcode this. Get this from display object. | 121 // TODO(derat|oshima): Don't hardcode this. Get this from display object. |
122 results->depth = 24; | 122 results->depth = 24; |
123 results->depthPerComponent = 8; | 123 results->depthPerComponent = 8; |
124 int default_dpi = display.device_scale_factor() * 160; | 124 int default_dpi = display.device_scale_factor() * 160; |
125 results->verticalDPI = default_dpi; | 125 results->verticalDPI = default_dpi; |
126 results->horizontalDPI = default_dpi; | 126 results->horizontalDPI = default_dpi; |
127 } | 127 } |
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1521 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( | 1521 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( |
1522 RenderWidgetHost* widget) { | 1522 RenderWidgetHost* widget) { |
1523 return new RenderWidgetHostViewAura(widget); | 1523 return new RenderWidgetHostViewAura(widget); |
1524 } | 1524 } |
1525 | 1525 |
1526 // static | 1526 // static |
1527 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 1527 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
1528 WebKit::WebScreenInfo* results) { | 1528 WebKit::WebScreenInfo* results) { |
1529 GetScreenInfoForWindow(results, NULL); | 1529 GetScreenInfoForWindow(results, NULL); |
1530 } | 1530 } |
OLD | NEW |