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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 bool RenderWidgetHostViewAura::IsShowing() { | 337 bool RenderWidgetHostViewAura::IsShowing() { |
338 return window_->IsVisible(); | 338 return window_->IsVisible(); |
339 } | 339 } |
340 | 340 |
341 gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { | 341 gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { |
342 return window_->GetBoundsInRootWindow(); | 342 return window_->GetBoundsInRootWindow(); |
343 } | 343 } |
344 | 344 |
345 void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) { | 345 void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) { |
346 current_cursor_ = cursor; | 346 current_cursor_ = cursor; |
| 347 const gfx::Display display = gfx::Screen::GetDisplayNearestWindow(window_); |
| 348 current_cursor_.SetScaleFactor(display.device_scale_factor()); |
347 UpdateCursorIfOverSelf(); | 349 UpdateCursorIfOverSelf(); |
348 } | 350 } |
349 | 351 |
350 void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) { | 352 void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) { |
351 is_loading_ = is_loading; | 353 is_loading_ = is_loading; |
352 UpdateCursorIfOverSelf(); | 354 UpdateCursorIfOverSelf(); |
353 } | 355 } |
354 | 356 |
355 void RenderWidgetHostViewAura::TextInputStateChanged( | 357 void RenderWidgetHostViewAura::TextInputStateChanged( |
356 ui::TextInputType type, | 358 ui::TextInputType type, |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 float device_scale_factor) { | 1170 float device_scale_factor) { |
1169 if (!host_) | 1171 if (!host_) |
1170 return; | 1172 return; |
1171 | 1173 |
1172 BackingStoreAura* backing_store = static_cast<BackingStoreAura*>( | 1174 BackingStoreAura* backing_store = static_cast<BackingStoreAura*>( |
1173 host_->GetBackingStore(false)); | 1175 host_->GetBackingStore(false)); |
1174 if (backing_store) // NULL in hardware path. | 1176 if (backing_store) // NULL in hardware path. |
1175 backing_store->ScaleFactorChanged(device_scale_factor); | 1177 backing_store->ScaleFactorChanged(device_scale_factor); |
1176 | 1178 |
1177 host_->SetDeviceScaleFactor(device_scale_factor); | 1179 host_->SetDeviceScaleFactor(device_scale_factor); |
| 1180 current_cursor_.SetScaleFactor(device_scale_factor); |
1178 } | 1181 } |
1179 | 1182 |
1180 void RenderWidgetHostViewAura::OnWindowDestroying() { | 1183 void RenderWidgetHostViewAura::OnWindowDestroying() { |
1181 } | 1184 } |
1182 | 1185 |
1183 void RenderWidgetHostViewAura::OnWindowDestroyed() { | 1186 void RenderWidgetHostViewAura::OnWindowDestroyed() { |
1184 host_->ViewDestroyed(); | 1187 host_->ViewDestroyed(); |
1185 delete this; | 1188 delete this; |
1186 } | 1189 } |
1187 | 1190 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( | 1416 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( |
1414 RenderWidgetHost* widget) { | 1417 RenderWidgetHost* widget) { |
1415 return new RenderWidgetHostViewAura(widget); | 1418 return new RenderWidgetHostViewAura(widget); |
1416 } | 1419 } |
1417 | 1420 |
1418 // static | 1421 // static |
1419 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 1422 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
1420 WebKit::WebScreenInfo* results) { | 1423 WebKit::WebScreenInfo* results) { |
1421 GetScreenInfoForWindow(results, NULL); | 1424 GetScreenInfoForWindow(results, NULL); |
1422 } | 1425 } |
OLD | NEW |