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

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

Issue 55303006: Make sure the non browser/non app widget is fully visible when created on ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/views_delegate.h ('k') | ui/views/widget/widget_delegate.h » ('j') | 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/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 bool Widget::GetSavedWindowPlacement(gfx::Rect* bounds, 1389 bool Widget::GetSavedWindowPlacement(gfx::Rect* bounds,
1390 ui::WindowShowState* show_state) { 1390 ui::WindowShowState* show_state) {
1391 // First we obtain the window's saved show-style and store it. We need to do 1391 // First we obtain the window's saved show-style and store it. We need to do
1392 // this here, rather than in Show() because by the time Show() is called, 1392 // this here, rather than in Show() because by the time Show() is called,
1393 // the window's size will have been reset (below) and the saved maximized 1393 // the window's size will have been reset (below) and the saved maximized
1394 // state will have been lost. Sadly there's no way to tell on Windows when 1394 // state will have been lost. Sadly there's no way to tell on Windows when
1395 // a window is restored from maximized state, so we can't more accurately 1395 // a window is restored from maximized state, so we can't more accurately
1396 // track maximized state independently of sizing information. 1396 // track maximized state independently of sizing information.
1397 1397
1398 // Restore the window's placement from the controller. 1398 // Restore the window's placement from the controller.
1399 if (widget_delegate_->GetSavedWindowPlacement(bounds, show_state)) { 1399 if (widget_delegate_->GetSavedWindowPlacement(this, bounds, show_state)) {
1400 if (!widget_delegate_->ShouldRestoreWindowSize()) { 1400 if (!widget_delegate_->ShouldRestoreWindowSize()) {
1401 bounds->set_size(non_client_view_->GetPreferredSize()); 1401 bounds->set_size(non_client_view_->GetPreferredSize());
1402 } else { 1402 } else {
1403 gfx::Size minimum_size = GetMinimumSize(); 1403 gfx::Size minimum_size = GetMinimumSize();
1404 // Make sure the bounds are at least the minimum size. 1404 // Make sure the bounds are at least the minimum size.
1405 if (bounds->width() < minimum_size.width()) 1405 if (bounds->width() < minimum_size.width())
1406 bounds->set_width(minimum_size.width()); 1406 bounds->set_width(minimum_size.width());
1407 1407
1408 if (bounds->height() < minimum_size.height()) 1408 if (bounds->height() < minimum_size.height())
1409 bounds->set_height(minimum_size.height()); 1409 bounds->set_height(minimum_size.height());
(...skipping 20 matching lines...) Expand all
1430 1430
1431 //////////////////////////////////////////////////////////////////////////////// 1431 ////////////////////////////////////////////////////////////////////////////////
1432 // internal::NativeWidgetPrivate, NativeWidget implementation: 1432 // internal::NativeWidgetPrivate, NativeWidget implementation:
1433 1433
1434 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1434 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1435 return this; 1435 return this;
1436 } 1436 }
1437 1437
1438 } // namespace internal 1438 } // namespace internal
1439 } // namespace views 1439 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/views_delegate.h ('k') | ui/views/widget/widget_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698