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

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

Issue 8869005: Revert EnableClose() removal and related crash fixes. I don't understand the crashes here, and th... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | Annotate | Revision Log
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
492 void Widget::Show() { 498 void Widget::Show() {
493 if (non_client_view_) { 499 if (non_client_view_) {
494 if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED && 500 if (saved_show_state_ == ui::SHOW_STATE_MAXIMIZED &&
495 !initial_restored_bounds_.IsEmpty()) { 501 !initial_restored_bounds_.IsEmpty()) {
496 native_widget_->ShowMaximizedWithBounds(initial_restored_bounds_); 502 native_widget_->ShowMaximizedWithBounds(initial_restored_bounds_);
497 } else { 503 } else {
498 native_widget_->ShowWithWindowState(saved_show_state_); 504 native_widget_->ShowWithWindowState(saved_show_state_);
499 } 505 }
500 // |saved_show_state_| only applies the first time the window is shown. 506 // |saved_show_state_| only applies the first time the window is shown.
501 // If we don't reset the value the window may be shown maximized every time 507 // If we don't reset the value the window may be shown maximized every time
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 1204
1199 //////////////////////////////////////////////////////////////////////////////// 1205 ////////////////////////////////////////////////////////////////////////////////
1200 // internal::NativeWidgetPrivate, NativeWidget implementation: 1206 // internal::NativeWidgetPrivate, NativeWidget implementation:
1201 1207
1202 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1208 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1203 return this; 1209 return this;
1204 } 1210 }
1205 1211
1206 } // namespace internal 1212 } // namespace internal
1207 } // namespace views 1213 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698