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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 gfx::Screen::GetScreenFor(window)->GetDisplayNearestWindow(window) : | 152 gfx::Screen::GetScreenFor(window)->GetDisplayNearestWindow(window) : |
153 gfx::Screen::GetScreenFor(window)->GetPrimaryDisplay(); | 153 gfx::Screen::GetScreenFor(window)->GetPrimaryDisplay(); |
154 results->rect = display.bounds(); | 154 results->rect = display.bounds(); |
155 results->availableRect = display.work_area(); | 155 results->availableRect = display.work_area(); |
156 // TODO(derat|oshima): Don't hardcode this. Get this from display object. | 156 // TODO(derat|oshima): Don't hardcode this. Get this from display object. |
157 results->depth = 24; | 157 results->depth = 24; |
158 results->depthPerComponent = 8; | 158 results->depthPerComponent = 8; |
159 int default_dpi = display.device_scale_factor() * 160; | 159 int default_dpi = display.device_scale_factor() * 160; |
160 results->verticalDPI = default_dpi; | 160 results->verticalDPI = default_dpi; |
161 results->horizontalDPI = default_dpi; | 161 results->horizontalDPI = default_dpi; |
| 162 results->deviceScaleFactor = display.device_scale_factor(); |
162 } | 163 } |
163 | 164 |
164 bool ShouldSendPinchGesture() { | 165 bool ShouldSendPinchGesture() { |
165 static bool pinch_allowed = | 166 static bool pinch_allowed = |
166 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableViewport) || | 167 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableViewport) || |
167 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePinch); | 168 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePinch); |
168 return pinch_allowed; | 169 return pinch_allowed; |
169 } | 170 } |
170 | 171 |
171 bool ShouldReleaseFrontSurface() { | 172 bool ShouldReleaseFrontSurface() { |
(...skipping 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1971 RenderWidgetHost* widget) { | 1972 RenderWidgetHost* widget) { |
1972 return new RenderWidgetHostViewAura(widget); | 1973 return new RenderWidgetHostViewAura(widget); |
1973 } | 1974 } |
1974 | 1975 |
1975 // static | 1976 // static |
1976 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 1977 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
1977 GetScreenInfoForWindow(results, NULL); | 1978 GetScreenInfoForWindow(results, NULL); |
1978 } | 1979 } |
1979 | 1980 |
1980 } // namespace content | 1981 } // namespace content |
OLD | NEW |