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

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

Issue 1560223002: Add quick launcher for launching mojo apps from within mash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@launcher
Patch Set: . Created 4 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 | « mash/shell/shell_application_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/widget.cc
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index aaa93204548a5852016807a0b8235ed343020f68..04c9011b9d92d0689770a0fc8631518cc489c587 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -1449,9 +1449,16 @@ void Widget::SetInitialBounds(const gfx::Rect& bounds) {
}
} else {
if (bounds.IsEmpty()) {
- // No initial bounds supplied, so size the window to its content and
- // center over its parent.
- native_widget_->CenterWindow(non_client_view_->GetPreferredSize());
+ if (bounds.origin().IsOrigin()) {
+ // No initial bounds supplied, so size the window to its content and
+ // center over its parent.
+ native_widget_->CenterWindow(non_client_view_->GetPreferredSize());
+ } else {
+ // Use the preferred size and the supplied origin.
+ gfx::Rect preferred_bounds(bounds);
+ preferred_bounds.set_size(non_client_view_->GetPreferredSize());
+ SetBoundsConstrained(preferred_bounds);
+ }
} else {
// Use the supplied initial bounds.
SetBoundsConstrained(bounds);
« no previous file with comments | « mash/shell/shell_application_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698