| 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 <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 2433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2444 else if (!overscroll_controller_) | 2444 else if (!overscroll_controller_) |
| 2445 overscroll_controller_.reset(new OverscrollController()); | 2445 overscroll_controller_.reset(new OverscrollController()); |
| 2446 } | 2446 } |
| 2447 | 2447 |
| 2448 void RenderWidgetHostViewAura::SnapToPhysicalPixelBoundary() { | 2448 void RenderWidgetHostViewAura::SnapToPhysicalPixelBoundary() { |
| 2449 // The top left corner of our view in window coordinates might not land on a | 2449 // The top left corner of our view in window coordinates might not land on a |
| 2450 // device pixel boundary if we have a non-integer device scale. In that case, | 2450 // device pixel boundary if we have a non-integer device scale. In that case, |
| 2451 // to avoid the web contents area looking blurry we translate the web contents | 2451 // to avoid the web contents area looking blurry we translate the web contents |
| 2452 // in the +x, +y direction to land on the nearest pixel boundary. This may | 2452 // in the +x, +y direction to land on the nearest pixel boundary. This may |
| 2453 // cause the bottom and right edges to be clipped slightly, but that's ok. | 2453 // cause the bottom and right edges to be clipped slightly, but that's ok. |
| 2454 #if defined(OS_CHROMEOS) |
| 2455 aura::Window* snapped = window_->GetToplevelWindow(); |
| 2456 #else |
| 2454 aura::Window* snapped = window_->GetRootWindow(); | 2457 aura::Window* snapped = window_->GetRootWindow(); |
| 2458 #endif |
| 2459 |
| 2455 if (snapped && snapped != window_) | 2460 if (snapped && snapped != window_) |
| 2456 ui::SnapLayerToPhysicalPixelBoundary(snapped->layer(), window_->layer()); | 2461 ui::SnapLayerToPhysicalPixelBoundary(snapped->layer(), window_->layer()); |
| 2457 | 2462 |
| 2458 has_snapped_to_boundary_ = true; | 2463 has_snapped_to_boundary_ = true; |
| 2459 } | 2464 } |
| 2460 | 2465 |
| 2461 bool RenderWidgetHostViewAura::OnShowContextMenu( | 2466 bool RenderWidgetHostViewAura::OnShowContextMenu( |
| 2462 const ContextMenuParams& params) { | 2467 const ContextMenuParams& params) { |
| 2463 #if defined(OS_WIN) | 2468 #if defined(OS_WIN) |
| 2464 last_context_menu_params_.reset(); | 2469 last_context_menu_params_.reset(); |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2858 | 2863 |
| 2859 //////////////////////////////////////////////////////////////////////////////// | 2864 //////////////////////////////////////////////////////////////////////////////// |
| 2860 // RenderWidgetHostViewBase, public: | 2865 // RenderWidgetHostViewBase, public: |
| 2861 | 2866 |
| 2862 // static | 2867 // static |
| 2863 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 2868 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 2864 GetScreenInfoForWindow(results, NULL); | 2869 GetScreenInfoForWindow(results, NULL); |
| 2865 } | 2870 } |
| 2866 | 2871 |
| 2867 } // namespace content | 2872 } // namespace content |
| OLD | NEW |