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

Unified Diff: trunk/src/ui/aura/root_window.cc

Issue 133003002: Revert 244005 "Remove SetHostSize/Bounds from RootWindow in favo..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 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
« no previous file with comments | « trunk/src/ui/aura/root_window.h ('k') | trunk/src/ui/aura/test/aura_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/aura/root_window.cc
===================================================================
--- trunk/src/ui/aura/root_window.cc (revision 244032)
+++ trunk/src/ui/aura/root_window.cc (working copy)
@@ -194,6 +194,33 @@
return this;
}
+void RootWindow::SetHostSize(const gfx::Size& size_in_pixel) {
+ DispatchDetails details = DispatchHeldEvents();
+ if (details.dispatcher_destroyed)
+ return;
+ gfx::Rect bounds = host_->GetBounds();
+ bounds.set_size(size_in_pixel);
+ host_->SetBounds(bounds);
+
+ // Requery the location to constrain it within the new root window size.
+ gfx::Point point;
+ if (host_->QueryMouseLocation(&point)) {
+ SetLastMouseLocation(window(),
+ ui::ConvertPointToDIP(window()->layer(), point));
+ }
+
+ synthesize_mouse_move_ = false;
+}
+
+void RootWindow::SetHostBounds(const gfx::Rect& bounds_in_pixel) {
+ DCHECK(!bounds_in_pixel.IsEmpty());
+ DispatchDetails details = DispatchHeldEvents();
+ if (details.dispatcher_destroyed)
+ return;
+ host_->SetBounds(bounds_in_pixel);
+ synthesize_mouse_move_ = false;
+}
+
void RootWindow::SetCursor(gfx::NativeCursor cursor) {
last_cursor_ = cursor;
// A lot of code seems to depend on NULL cursors actually showing an arrow,
@@ -713,14 +740,6 @@
return;
FOR_EACH_OBSERVER(RootWindowObserver, observers_,
OnWindowTreeHostResized(this));
-
- // Constrain the mouse position within the new root Window size.
- gfx::Point point;
- if (host_->QueryMouseLocation(&point)) {
- SetLastMouseLocation(window(),
- ui::ConvertPointToDIP(window()->layer(), point));
- }
- synthesize_mouse_move_ = false;
}
RootWindow* RootWindow::AsRootWindow() {
« no previous file with comments | « trunk/src/ui/aura/root_window.h ('k') | trunk/src/ui/aura/test/aura_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698