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

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

Issue 1130033003: Make the minimize state work when creating a chrome window in CrOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test failures Created 5 years, 2 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
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/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 layer ? layer->name() : "none"); 620 layer ? layer->name() : "none");
621 if (non_client_view_) { 621 if (non_client_view_) {
622 // While initializing, the kiosk mode will go to full screen before the 622 // While initializing, the kiosk mode will go to full screen before the
623 // widget gets shown. In that case we stay in full screen mode, regardless 623 // widget gets shown. In that case we stay in full screen mode, regardless
624 // of the |saved_show_state_| member. 624 // of the |saved_show_state_| member.
625 if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED && 625 if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED &&
626 !initial_restored_bounds_.IsEmpty() && 626 !initial_restored_bounds_.IsEmpty() &&
627 !IsFullscreen()) { 627 !IsFullscreen()) {
628 native_widget_->ShowMaximizedWithBounds(initial_restored_bounds_); 628 native_widget_->ShowMaximizedWithBounds(initial_restored_bounds_);
629 } else { 629 } else {
630 native_widget_->ShowWithWindowState( 630 if (IsFullscreen()) {
631 IsFullscreen() ? ui::SHOW_STATE_FULLSCREEN : saved_show_state_); 631 native_widget_->ShowWithWindowState(ui::SHOW_STATE_FULLSCREEN);
632 } else {
633 native_widget_->ShowWithWindowState(
634 IsMinimized() ? ui::SHOW_STATE_MINIMIZED : saved_show_state_);
635 }
632 } 636 }
633 // |saved_show_state_| only applies the first time the window is shown. 637 // |saved_show_state_| only applies the first time the window is shown.
634 // If we don't reset the value the window may be shown maximized every time 638 // If we don't reset the value the window may be shown maximized every time
635 // it is subsequently shown after being hidden. 639 // it is subsequently shown after being hidden.
636 saved_show_state_ = ui::SHOW_STATE_NORMAL; 640 saved_show_state_ = ui::SHOW_STATE_NORMAL;
637 } else { 641 } else {
638 CanActivate() 642 CanActivate()
639 ? native_widget_->Show() 643 ? native_widget_->Show()
640 : native_widget_->ShowWithWindowState(ui::SHOW_STATE_INACTIVE); 644 : native_widget_->ShowWithWindowState(ui::SHOW_STATE_INACTIVE);
641 } 645 }
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 1497
1494 //////////////////////////////////////////////////////////////////////////////// 1498 ////////////////////////////////////////////////////////////////////////////////
1495 // internal::NativeWidgetPrivate, NativeWidget implementation: 1499 // internal::NativeWidgetPrivate, NativeWidget implementation:
1496 1500
1497 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1501 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1498 return this; 1502 return this;
1499 } 1503 }
1500 1504
1501 } // namespace internal 1505 } // namespace internal
1502 } // namespace views 1506 } // namespace views
OLDNEW
« ui/views/widget/native_widget_aura.cc ('K') | « ui/views/widget/native_widget_aura_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698