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

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

Issue 8618001: Get rid of the EnableClose() infrastructure in Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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/widget/widget.h ('k') | ui/views/window/custom_frame_view.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 8 #include "base/message_loop.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "ui/base/hit_test.h" 10 #include "ui/base/hit_test.h"
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 482
483 native_widget_->Close(); 483 native_widget_->Close();
484 widget_closed_ = true; 484 widget_closed_ = true;
485 } 485 }
486 } 486 }
487 487
488 void Widget::CloseNow() { 488 void Widget::CloseNow() {
489 native_widget_->CloseNow(); 489 native_widget_->CloseNow();
490 } 490 }
491 491
492 void Widget::EnableClose(bool enable) {
493 if (non_client_view_)
494 non_client_view_->EnableClose(enable);
495 native_widget_->EnableClose(enable);
496 }
497
498 void Widget::Show() { 492 void Widget::Show() {
499 if (non_client_view_) { 493 if (non_client_view_) {
500 if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED && 494 if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED &&
501 !initial_restored_bounds_.IsEmpty()) { 495 !initial_restored_bounds_.IsEmpty()) {
502 native_widget_->ShowMaximizedWithBounds(initial_restored_bounds_); 496 native_widget_->ShowMaximizedWithBounds(initial_restored_bounds_);
503 } else { 497 } else {
504 native_widget_->ShowWithWindowState(saved_show_state_); 498 native_widget_->ShowWithWindowState(saved_show_state_);
505 } 499 }
506 // |saved_show_state_| only applies the first time the window is shown. 500 // |saved_show_state_| only applies the first time the window is shown.
507 // If we don't reset the value the window may be shown maximized every time 501 // If we don't reset the value the window may be shown maximized every time
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 1203
1210 //////////////////////////////////////////////////////////////////////////////// 1204 ////////////////////////////////////////////////////////////////////////////////
1211 // internal::NativeWidgetPrivate, NativeWidget implementation: 1205 // internal::NativeWidgetPrivate, NativeWidget implementation:
1212 1206
1213 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1207 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1214 return this; 1208 return this;
1215 } 1209 }
1216 1210
1217 } // namespace internal 1211 } // namespace internal
1218 } // namespace views 1212 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/widget.h ('k') | ui/views/window/custom_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698