Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2056503002: Snap content to the top level window on chromeos (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2570 matching lines...) Expand 10 before | Expand all | Expand 10 after
2581 else if (!overscroll_controller_) 2581 else if (!overscroll_controller_)
2582 overscroll_controller_.reset(new OverscrollController()); 2582 overscroll_controller_.reset(new OverscrollController());
2583 } 2583 }
2584 2584
2585 void RenderWidgetHostViewAura::SnapToPhysicalPixelBoundary() { 2585 void RenderWidgetHostViewAura::SnapToPhysicalPixelBoundary() {
2586 // The top left corner of our view in window coordinates might not land on a 2586 // The top left corner of our view in window coordinates might not land on a
2587 // device pixel boundary if we have a non-integer device scale. In that case, 2587 // device pixel boundary if we have a non-integer device scale. In that case,
2588 // to avoid the web contents area looking blurry we translate the web contents 2588 // to avoid the web contents area looking blurry we translate the web contents
2589 // in the +x, +y direction to land on the nearest pixel boundary. This may 2589 // in the +x, +y direction to land on the nearest pixel boundary. This may
2590 // cause the bottom and right edges to be clipped slightly, but that's ok. 2590 // cause the bottom and right edges to be clipped slightly, but that's ok.
2591 #if defined(OS_CHROMEOS)
2592 aura::Window* snapped = window_->GetToplevelWindow();
2593 #else
2591 aura::Window* snapped = window_->GetRootWindow(); 2594 aura::Window* snapped = window_->GetRootWindow();
2595 #endif
sadrul 2016/06/09 02:57:04 It may be OK to use GetToplevelWindow() on non-chr
2596
2592 if (snapped && snapped != window_) 2597 if (snapped && snapped != window_)
2593 ui::SnapLayerToPhysicalPixelBoundary(snapped->layer(), window_->layer()); 2598 ui::SnapLayerToPhysicalPixelBoundary(snapped->layer(), window_->layer());
2594 2599
2595 has_snapped_to_boundary_ = true; 2600 has_snapped_to_boundary_ = true;
2596 } 2601 }
2597 2602
2598 bool RenderWidgetHostViewAura::OnShowContextMenu( 2603 bool RenderWidgetHostViewAura::OnShowContextMenu(
2599 const ContextMenuParams& params) { 2604 const ContextMenuParams& params) {
2600 #if defined(OS_WIN) 2605 #if defined(OS_WIN)
2601 last_context_menu_params_.reset(); 2606 last_context_menu_params_.reset();
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
3000 3005
3001 //////////////////////////////////////////////////////////////////////////////// 3006 ////////////////////////////////////////////////////////////////////////////////
3002 // RenderWidgetHostViewBase, public: 3007 // RenderWidgetHostViewBase, public:
3003 3008
3004 // static 3009 // static
3005 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 3010 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
3006 GetScreenInfoForWindow(results, NULL); 3011 GetScreenInfoForWindow(results, NULL);
3007 } 3012 }
3008 3013
3009 } // namespace content 3014 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698