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

Side by Side Diff: ui/aura/window.cc

Issue 10210005: Ash/aura split: NativeWidgetAura::GetWindowScreenBounds() should return screen bounds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
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/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 } 192 }
193 193
194 bool Window::IsVisible() const { 194 bool Window::IsVisible() const {
195 // Layer visibility can be inconsistent with window visibility, for example 195 // Layer visibility can be inconsistent with window visibility, for example
196 // when a Window is hidden, we want this function to return false immediately 196 // when a Window is hidden, we want this function to return false immediately
197 // after, even though the client may decide to animate the hide effect (and 197 // after, even though the client may decide to animate the hide effect (and
198 // so the layer will be visible for some time after Hide() is called). 198 // so the layer will be visible for some time after Hide() is called).
199 return visible_ && layer_ && layer_->IsDrawn(); 199 return visible_ && layer_ && layer_->IsDrawn();
200 } 200 }
201 201
202 gfx::Rect Window::GetScreenBounds() const { 202 gfx::Rect Window::GetBoundsInRootWindow() const {
203 // TODO(beng): There may be a better way to handle this, and the existing code 203 // TODO(beng): There may be a better way to handle this, and the existing code
204 // is likely wrong anyway in a multi-monitor world, but this will 204 // is likely wrong anyway in a multi-monitor world, but this will
205 // do for now. 205 // do for now.
206 if (!GetRootWindow()) 206 if (!GetRootWindow())
207 return bounds(); 207 return bounds();
208 gfx::Point origin = bounds().origin(); 208 gfx::Point origin = bounds().origin();
209 Window::ConvertPointToWindow(parent_, GetRootWindow(), &origin); 209 Window::ConvertPointToWindow(parent_, GetRootWindow(), &origin);
210 return gfx::Rect(origin, bounds().size()); 210 return gfx::Rect(origin, bounds().size());
211 } 211 }
212 212
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 if (id_ != -1) { 806 if (id_ != -1) {
807 char id_buf[10]; 807 char id_buf[10];
808 base::snprintf(id_buf, sizeof(id_buf), " %d", id_); 808 base::snprintf(id_buf, sizeof(id_buf), " %d", id_);
809 layer_name.append(id_buf); 809 layer_name.append(id_buf);
810 } 810 }
811 layer()->set_name(layer_name); 811 layer()->set_name(layer_name);
812 #endif 812 #endif
813 } 813 }
814 814
815 } // namespace aura 815 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698