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 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_VIEWS_H_ | 5 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_VIEWS_H_ |
6 #define VIEWS_WIDGET_NATIVE_WIDGET_VIEWS_H_ | 6 #define VIEWS_WIDGET_NATIVE_WIDGET_VIEWS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "ui/gfx/transform.h" | 10 #include "ui/gfx/transform.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 public: | 24 public: |
25 explicit NativeWidgetViews(internal::NativeWidgetDelegate* delegate); | 25 explicit NativeWidgetViews(internal::NativeWidgetDelegate* delegate); |
26 virtual ~NativeWidgetViews(); | 26 virtual ~NativeWidgetViews(); |
27 | 27 |
28 // TODO(beng): remove. | 28 // TODO(beng): remove. |
29 View* GetView(); | 29 View* GetView(); |
30 const View* GetView() const; | 30 const View* GetView() const; |
31 | 31 |
32 void OnActivate(bool active); | 32 void OnActivate(bool active); |
33 | 33 |
| 34 void set_delete_native_view(bool delete_native_view) { |
| 35 delete_native_view_ = delete_native_view; |
| 36 } |
| 37 |
34 internal::NativeWidgetDelegate* delegate() { return delegate_; } | 38 internal::NativeWidgetDelegate* delegate() { return delegate_; } |
35 | 39 |
36 protected: | 40 protected: |
37 // Overridden from internal::NativeWidgetPrivate: | 41 // Overridden from internal::NativeWidgetPrivate: |
38 virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; | 42 virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; |
39 virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE; | 43 virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE; |
40 virtual void UpdateFrameAfterFrameChange() OVERRIDE; | 44 virtual void UpdateFrameAfterFrameChange() OVERRIDE; |
41 virtual bool ShouldUseNativeFrame() const OVERRIDE; | 45 virtual bool ShouldUseNativeFrame() const OVERRIDE; |
42 virtual void FrameTypeChanged() OVERRIDE; | 46 virtual void FrameTypeChanged() OVERRIDE; |
43 virtual Widget* GetWidget() OVERRIDE; | 47 virtual Widget* GetWidget() OVERRIDE; |
44 virtual const Widget* GetWidget() const OVERRIDE; | 48 virtual const Widget* GetWidget() const OVERRIDE; |
45 virtual gfx::NativeView GetNativeView() const OVERRIDE; | 49 virtual gfx::NativeView GetNativeView() const OVERRIDE; |
46 virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE; | 50 virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE; |
| 51 virtual Widget* GetTopLevelWidget() OVERRIDE; |
47 virtual const ui::Compositor* GetCompositor() const OVERRIDE; | 52 virtual const ui::Compositor* GetCompositor() const OVERRIDE; |
48 virtual ui::Compositor* GetCompositor() OVERRIDE; | 53 virtual ui::Compositor* GetCompositor() OVERRIDE; |
49 virtual void MarkLayerDirty() OVERRIDE; | 54 virtual void MarkLayerDirty() OVERRIDE; |
50 virtual void CalculateOffsetToAncestorWithLayer(gfx::Point* offset, | 55 virtual void CalculateOffsetToAncestorWithLayer(gfx::Point* offset, |
51 View** ancestor) OVERRIDE; | 56 View** ancestor) OVERRIDE; |
52 virtual void ViewRemoved(View* view) OVERRIDE; | 57 virtual void ViewRemoved(View* view) OVERRIDE; |
53 virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE; | 58 virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE; |
54 virtual void* GetNativeWindowProperty(const char* name) const OVERRIDE; | 59 virtual void* GetNativeWindowProperty(const char* name) const OVERRIDE; |
55 virtual TooltipManager* GetTooltipManager() const OVERRIDE; | 60 virtual TooltipManager* GetTooltipManager() const OVERRIDE; |
56 virtual bool IsScreenReaderActive() const OVERRIDE; | 61 virtual bool IsScreenReaderActive() const OVERRIDE; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 virtual void RunShellDrag(View* view, | 112 virtual void RunShellDrag(View* view, |
108 const ui::OSExchangeData& data, | 113 const ui::OSExchangeData& data, |
109 int operation) OVERRIDE; | 114 int operation) OVERRIDE; |
110 virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE; | 115 virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE; |
111 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; | 116 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; |
112 | 117 |
113 private: | 118 private: |
114 internal::NativeWidgetPrivate* GetParentNativeWidget(); | 119 internal::NativeWidgetPrivate* GetParentNativeWidget(); |
115 const internal::NativeWidgetPrivate* GetParentNativeWidget() const; | 120 const internal::NativeWidgetPrivate* GetParentNativeWidget() const; |
116 | 121 |
| 122 // Called by the NativeWidgetView when it is deleted. |
| 123 void OnDestroy(); |
| 124 |
117 internal::NativeWidgetDelegate* delegate_; | 125 internal::NativeWidgetDelegate* delegate_; |
118 | 126 |
119 internal::NativeWidgetView* view_; | 127 internal::NativeWidgetView* view_; |
120 | 128 |
121 bool active_; | 129 bool active_; |
122 | 130 |
123 bool minimized_; | 131 bool minimized_; |
124 | 132 |
125 // The following factory is used for calls to close the NativeWidgetViews | 133 // The following factory is used for calls to close the NativeWidgetViews |
126 // instance. | 134 // instance. |
127 ScopedRunnableMethodFactory<NativeWidgetViews> close_widget_factory_; | 135 ScopedRunnableMethodFactory<NativeWidgetViews> close_widget_factory_; |
128 | 136 |
129 gfx::Rect restored_bounds_; | 137 gfx::Rect restored_bounds_; |
130 ui::Transform restored_transform_; | 138 ui::Transform restored_transform_; |
131 | 139 |
132 Widget* hosting_widget_; | 140 Widget* hosting_widget_; |
133 | 141 |
| 142 // See class documentation for Widget in widget.h for a note about ownership. |
| 143 Widget::InitParams::Ownership ownership_; |
| 144 |
| 145 bool delete_native_view_; |
| 146 |
134 DISALLOW_COPY_AND_ASSIGN(NativeWidgetViews); | 147 DISALLOW_COPY_AND_ASSIGN(NativeWidgetViews); |
135 }; | 148 }; |
136 | 149 |
137 } | 150 } // namespace views |
138 | 151 |
139 #endif // VIEWS_WIDGET_NATIVE_WIDGET_VIEWS_H_ | 152 #endif // VIEWS_WIDGET_NATIVE_WIDGET_VIEWS_H_ |
OLD | NEW |