| OLD | NEW |
| 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 "views/widget/widget.h" | 5 #include "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/l10n/l10n_font_util.h" | 10 #include "ui/base/l10n/l10n_font_util.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 146 } |
| 147 | 147 |
| 148 Widget::~Widget() { | 148 Widget::~Widget() { |
| 149 while (!event_stack_.empty()) { | 149 while (!event_stack_.empty()) { |
| 150 event_stack_.top()->reset(); | 150 event_stack_.top()->reset(); |
| 151 event_stack_.pop(); | 151 event_stack_.pop(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 DestroyRootView(); | 154 DestroyRootView(); |
| 155 | 155 |
| 156 if (ownership_ == InitParams::WIDGET_OWNS_NATIVE_WIDGET) { | 156 if (ownership_ == InitParams::WIDGET_OWNS_NATIVE_WIDGET) |
| 157 CloseNow(); | |
| 158 delete native_widget_; | 157 delete native_widget_; |
| 159 } | |
| 160 } | 158 } |
| 161 | 159 |
| 162 // static | 160 // static |
| 163 Widget* Widget::CreateWindow(WidgetDelegate* delegate) { | 161 Widget* Widget::CreateWindow(WidgetDelegate* delegate) { |
| 164 return CreateWindowWithParentAndBounds(delegate, NULL, gfx::Rect()); | 162 return CreateWindowWithParentAndBounds(delegate, NULL, gfx::Rect()); |
| 165 } | 163 } |
| 166 | 164 |
| 167 // static | 165 // static |
| 168 Widget* Widget::CreateWindowWithParent(WidgetDelegate* delegate, | 166 Widget* Widget::CreateWindowWithParent(WidgetDelegate* delegate, |
| 169 gfx::NativeWindow parent) { | 167 gfx::NativeWindow parent) { |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 | 1010 |
| 1013 //////////////////////////////////////////////////////////////////////////////// | 1011 //////////////////////////////////////////////////////////////////////////////// |
| 1014 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1012 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1015 | 1013 |
| 1016 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1014 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1017 return this; | 1015 return this; |
| 1018 } | 1016 } |
| 1019 | 1017 |
| 1020 } // namespace internal | 1018 } // namespace internal |
| 1021 } // namespace views | 1019 } // namespace views |
| OLD | NEW |