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

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: remove the parentheses in the inline if statement Created 5 years 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
« no previous file with comments | « ui/views/widget/native_widget_aura_unittest.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/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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 layer ? layer->name() : "none"); 629 layer ? layer->name() : "none");
630 if (non_client_view_) { 630 if (non_client_view_) {
631 // While initializing, the kiosk mode will go to full screen before the 631 // While initializing, the kiosk mode will go to full screen before the
632 // widget gets shown. In that case we stay in full screen mode, regardless 632 // widget gets shown. In that case we stay in full screen mode, regardless
633 // of the |saved_show_state_| member. 633 // of the |saved_show_state_| member.
634 if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED && 634 if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED &&
635 !initial_restored_bounds_.IsEmpty() && 635 !initial_restored_bounds_.IsEmpty() &&
636 !IsFullscreen()) { 636 !IsFullscreen()) {
637 native_widget_->ShowMaximizedWithBounds(initial_restored_bounds_); 637 native_widget_->ShowMaximizedWithBounds(initial_restored_bounds_);
638 } else { 638 } else {
639 native_widget_->ShowWithWindowState( 639 ui::WindowShowState show_state =
640 IsFullscreen() ? ui::SHOW_STATE_FULLSCREEN : saved_show_state_); 640 IsFullscreen() ? ui::SHOW_STATE_FULLSCREEN :
641 IsMinimized() ? ui::SHOW_STATE_MINIMIZED : saved_show_state_;
642 native_widget_->ShowWithWindowState(show_state);
641 } 643 }
642 // |saved_show_state_| only applies the first time the window is shown. 644 // |saved_show_state_| only applies the first time the window is shown.
643 // If we don't reset the value the window may be shown maximized every time 645 // If we don't reset the value the window may be shown maximized every time
644 // it is subsequently shown after being hidden. 646 // it is subsequently shown after being hidden.
645 saved_show_state_ = ui::SHOW_STATE_NORMAL; 647 saved_show_state_ = ui::SHOW_STATE_NORMAL;
646 } else { 648 } else {
647 CanActivate() 649 CanActivate()
648 ? native_widget_->Show() 650 ? native_widget_->Show()
649 : native_widget_->ShowWithWindowState(ui::SHOW_STATE_INACTIVE); 651 : native_widget_->ShowWithWindowState(ui::SHOW_STATE_INACTIVE);
650 } 652 }
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 1504
1503 //////////////////////////////////////////////////////////////////////////////// 1505 ////////////////////////////////////////////////////////////////////////////////
1504 // internal::NativeWidgetPrivate, NativeWidget implementation: 1506 // internal::NativeWidgetPrivate, NativeWidget implementation:
1505 1507
1506 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1508 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1507 return this; 1509 return this;
1508 } 1510 }
1509 1511
1510 } // namespace internal 1512 } // namespace internal
1511 } // namespace views 1513 } // namespace views
OLDNEW
« no previous file with comments | « 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