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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_screen_position_client.cc

Issue 1915363002: Rename gfx::Display/Screen to display::Display/Screen in views/wm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more cleanups Created 4 years, 7 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
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 "ui/views/widget/desktop_aura/desktop_screen_position_client.h" 5 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h"
6 6
7 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" 7 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
8 8
9 namespace views { 9 namespace views {
10 10
(...skipping 16 matching lines...) Expand all
27 : wm::DefaultScreenPositionClient(), root_window_(root_window) { 27 : wm::DefaultScreenPositionClient(), root_window_(root_window) {
28 aura::client::SetScreenPositionClient(root_window_, this); 28 aura::client::SetScreenPositionClient(root_window_, this);
29 } 29 }
30 30
31 DesktopScreenPositionClient::~DesktopScreenPositionClient() { 31 DesktopScreenPositionClient::~DesktopScreenPositionClient() {
32 aura::client::SetScreenPositionClient(root_window_, NULL); 32 aura::client::SetScreenPositionClient(root_window_, NULL);
33 } 33 }
34 34
35 void DesktopScreenPositionClient::SetBounds(aura::Window* window, 35 void DesktopScreenPositionClient::SetBounds(aura::Window* window,
36 const gfx::Rect& bounds, 36 const gfx::Rect& bounds,
37 const gfx::Display& display) { 37 const display::Display& display) {
38 // TODO(jam): Use the 3rd parameter, |display|. 38 // TODO(jam): Use the 3rd parameter, |display|.
39 aura::Window* root = window->GetRootWindow(); 39 aura::Window* root = window->GetRootWindow();
40 40
41 // This method assumes that |window| does not have an associated 41 // This method assumes that |window| does not have an associated
42 // DesktopNativeWidgetAura. 42 // DesktopNativeWidgetAura.
43 internal::NativeWidgetPrivate* desktop_native_widget = 43 internal::NativeWidgetPrivate* desktop_native_widget =
44 DesktopNativeWidgetAura::ForWindow(root); 44 DesktopNativeWidgetAura::ForWindow(root);
45 DCHECK(!desktop_native_widget || 45 DCHECK(!desktop_native_widget ||
46 desktop_native_widget->GetNativeView() != window); 46 desktop_native_widget->GetNativeView() != window);
47 47
48 if (PositionWindowInScreenCoordinates(window)) { 48 if (PositionWindowInScreenCoordinates(window)) {
49 // The caller expects windows we consider "embedded" to be placed in the 49 // The caller expects windows we consider "embedded" to be placed in the
50 // screen coordinate system. So we need to offset the root window's 50 // screen coordinate system. So we need to offset the root window's
51 // position (which is in screen coordinates) from these bounds. 51 // position (which is in screen coordinates) from these bounds.
52 52
53 gfx::Point origin = bounds.origin(); 53 gfx::Point origin = bounds.origin();
54 aura::Window::ConvertPointToTarget(window->parent(), root, &origin); 54 aura::Window::ConvertPointToTarget(window->parent(), root, &origin);
55 55
56 gfx::Point host_origin = GetOriginInScreen(root); 56 gfx::Point host_origin = GetOriginInScreen(root);
57 origin.Offset(-host_origin.x(), -host_origin.y()); 57 origin.Offset(-host_origin.x(), -host_origin.y());
58 window->SetBounds(gfx::Rect(origin, bounds.size())); 58 window->SetBounds(gfx::Rect(origin, bounds.size()));
59 return; 59 return;
60 } 60 }
61 61
62 window->SetBounds(bounds); 62 window->SetBounds(bounds);
63 } 63 }
64 64
65 } // namespace views 65 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_screen_position_client.h ('k') | ui/views/widget/desktop_aura/desktop_screen_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698