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/native_widget_view.h" | 5 #include "views/widget/native_widget_view.h" |
6 | 6 |
7 #include "ui/gfx/canvas.h" | 7 #include "ui/gfx/canvas.h" |
8 | 8 |
9 namespace views { | 9 namespace views { |
10 namespace internal { | 10 namespace internal { |
11 | 11 |
12 //////////////////////////////////////////////////////////////////////////////// | 12 //////////////////////////////////////////////////////////////////////////////// |
13 // NativeWidgetView, public: | 13 // NativeWidgetView, public: |
14 | 14 |
15 // static | 15 // static |
16 const char NativeWidgetView::kViewClassName[] = "views/NativeWidgetView"; | 16 const char NativeWidgetView::kViewClassName[] = "views/NativeWidgetView"; |
17 | 17 |
18 NativeWidgetView::NativeWidgetView(NativeWidgetViews* native_widget) | 18 NativeWidgetView::NativeWidgetView(NativeWidgetViews* native_widget) |
19 : native_widget_(native_widget), | 19 : native_widget_(native_widget), |
20 sent_create_(false) { | 20 sent_create_(false), |
| 21 delete_native_widget_(true) { |
21 } | 22 } |
22 | 23 |
23 NativeWidgetView::~NativeWidgetView() { | 24 NativeWidgetView::~NativeWidgetView() { |
| 25 if (delete_native_widget_) { |
| 26 native_widget_->set_delete_native_view(false); |
| 27 delete native_widget_; |
| 28 } |
24 } | 29 } |
25 | 30 |
26 Widget* NativeWidgetView::GetAssociatedWidget() { | 31 Widget* NativeWidgetView::GetAssociatedWidget() { |
27 return native_widget_->delegate()->AsWidget(); | 32 return native_widget_->delegate()->AsWidget(); |
28 } | 33 } |
29 | 34 |
30 //////////////////////////////////////////////////////////////////////////////// | 35 //////////////////////////////////////////////////////////////////////////////// |
31 // NativeWidgetView, View overrides: | 36 // NativeWidgetView, View overrides: |
32 | 37 |
33 void NativeWidgetView::SchedulePaintInternal(const gfx::Rect& r) { | 38 void NativeWidgetView::SchedulePaintInternal(const gfx::Rect& r) { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 } | 170 } |
166 | 171 |
167 void NativeWidgetView::PaintComposite() { | 172 void NativeWidgetView::PaintComposite() { |
168 View::PaintComposite(); | 173 View::PaintComposite(); |
169 GetAssociatedWidget()->GetRootView()->PaintComposite(); | 174 GetAssociatedWidget()->GetRootView()->PaintComposite(); |
170 } | 175 } |
171 | 176 |
172 } // namespace internal | 177 } // namespace internal |
173 } // namespace views | 178 } // namespace views |
174 | 179 |
OLD | NEW |