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

Unified Diff: ui/views/widget/desktop_aura/desktop_screen_position_client.cc

Issue 319013002: Reland Fix Views web-modal dialog widget creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert MediaGalleriesScanResultDialogViews::AcceptDialogForTesting. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/widget/desktop_aura/desktop_screen_position_client.cc
diff --git a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
index 2712ac87865a531e3e8a8966e915735ee472bf38..96deaf4205c58fdb47424eb823a50cb99104bd4b 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
@@ -15,13 +15,11 @@ namespace views {
namespace {
gfx::Point GetOrigin(const aura::Window* root_window) {
- gfx::Point origin_in_pixels =
- root_window->GetHost()->GetBounds().origin();
+ gfx::Point origin_in_pixels = root_window->GetHost()->GetBounds().origin();
aura::Window* window = const_cast<aura::Window*>(root_window);
float scale = gfx::Screen::GetScreenFor(window)->
GetDisplayNearestWindow(window).device_scale_factor();
- return gfx::ToFlooredPoint(
- gfx::ScalePoint(origin_in_pixels, 1 / scale));
+ return gfx::ToFlooredPoint(gfx::ScalePoint(origin_in_pixels, 1 / scale));
}
// Returns true if bounds passed to window are treated as though they are in
@@ -37,7 +35,8 @@ bool PositionWindowInScreenCoordinates(aura::Window* window) {
} // namespace
DesktopScreenPositionClient::DesktopScreenPositionClient(
- aura::Window* root_window) : root_window_(root_window) {
+ aura::Window* root_window)
+ : root_window_(root_window) {
aura::client::SetScreenPositionClient(root_window_, this);
}
@@ -46,7 +45,8 @@ DesktopScreenPositionClient::~DesktopScreenPositionClient() {
}
void DesktopScreenPositionClient::ConvertPointToScreen(
- const aura::Window* window, gfx::Point* point) {
+ const aura::Window* window,
+ gfx::Point* point) {
const aura::Window* root_window = window->GetRootWindow();
aura::Window::ConvertPointToTarget(window, root_window, point);
gfx::Point origin = GetOrigin(root_window);
@@ -54,23 +54,23 @@ void DesktopScreenPositionClient::ConvertPointToScreen(
}
void DesktopScreenPositionClient::ConvertPointFromScreen(
- const aura::Window* window, gfx::Point* point) {
+ const aura::Window* window,
+ gfx::Point* point) {
const aura::Window* root_window = window->GetRootWindow();
gfx::Point origin = GetOrigin(root_window);
point->Offset(-origin.x(), -origin.y());
aura::Window::ConvertPointToTarget(root_window, window, point);
}
-void DesktopScreenPositionClient::ConvertHostPointToScreen(
- aura::Window* window, gfx::Point* point) {
+void DesktopScreenPositionClient::ConvertHostPointToScreen(aura::Window* window,
+ gfx::Point* point) {
aura::Window* root_window = window->GetRootWindow();
ConvertPointToScreen(root_window, point);
}
-void DesktopScreenPositionClient::SetBounds(
- aura::Window* window,
- const gfx::Rect& bounds,
- const gfx::Display& display) {
+void DesktopScreenPositionClient::SetBounds(aura::Window* window,
+ const gfx::Rect& bounds,
+ const gfx::Display& display) {
// TODO: Use the 3rd parameter, |display|.
aura::Window* root = window->GetRootWindow();

Powered by Google App Engine
This is Rietveld 408576698