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

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

Issue 11818065: OK, here's john's patch plus my sync stuff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Redisable PlatformAppBrowserTest.WebContentsHasFocus on aura Created 7 years, 10 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
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_root_window_host_linux.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/widget.h" 5 #include "ui/views/widget/widget.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 void Widget::SetInitialBounds(const gfx::Rect& bounds) { 1347 void Widget::SetInitialBounds(const gfx::Rect& bounds) {
1348 if (!non_client_view_) 1348 if (!non_client_view_)
1349 return; 1349 return;
1350 1350
1351 gfx::Rect saved_bounds; 1351 gfx::Rect saved_bounds;
1352 if (GetSavedWindowPlacement(&saved_bounds, &saved_show_state_)) { 1352 if (GetSavedWindowPlacement(&saved_bounds, &saved_show_state_)) {
1353 if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED) { 1353 if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED) {
1354 // If we're going to maximize, wait until Show is invoked to set the 1354 // If we're going to maximize, wait until Show is invoked to set the
1355 // bounds. That way we avoid a noticeable resize. 1355 // bounds. That way we avoid a noticeable resize.
1356 initial_restored_bounds_ = saved_bounds; 1356 initial_restored_bounds_ = saved_bounds;
1357 } else { 1357 } else if (!saved_bounds.IsEmpty()) {
1358 // If the saved bounds are valid, use them.
1358 SetBounds(saved_bounds); 1359 SetBounds(saved_bounds);
1359 } 1360 }
1360 } else { 1361 } else {
1361 if (bounds.IsEmpty()) { 1362 if (bounds.IsEmpty()) {
1362 // No initial bounds supplied, so size the window to its content and 1363 // No initial bounds supplied, so size the window to its content and
1363 // center over its parent. 1364 // center over its parent.
1364 native_widget_->CenterWindow(non_client_view_->GetPreferredSize()); 1365 native_widget_->CenterWindow(non_client_view_->GetPreferredSize());
1365 } else { 1366 } else {
1366 // Use the supplied initial bounds. 1367 // Use the supplied initial bounds.
1367 SetBoundsConstrained(bounds); 1368 SetBoundsConstrained(bounds);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 1422
1422 //////////////////////////////////////////////////////////////////////////////// 1423 ////////////////////////////////////////////////////////////////////////////////
1423 // internal::NativeWidgetPrivate, NativeWidget implementation: 1424 // internal::NativeWidgetPrivate, NativeWidget implementation:
1424 1425
1425 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1426 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1426 return this; 1427 return this;
1427 } 1428 }
1428 1429
1429 } // namespace internal 1430 } // namespace internal
1430 } // namespace views 1431 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_root_window_host_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698