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_WIN_H_ | 5 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_VIEWS_H_ |
6 #define VIEWS_WIDGET_NATIVE_WIDGET_WIN_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 "views/widget/native_widget.h" | 10 #include "views/widget/native_widget.h" |
11 | 11 |
12 namespace views { | 12 namespace views { |
| 13 namespace internal { |
| 14 class NativeWidgetView; |
| 15 } |
13 | 16 |
| 17 //////////////////////////////////////////////////////////////////////////////// |
| 18 // NativeWidgetViews |
| 19 // |
| 20 // A NativeWidget implementation that uses another View as its native widget. |
| 21 // |
14 class NativeWidgetViews : public NativeWidget { | 22 class NativeWidgetViews : public NativeWidget { |
15 public: | 23 public: |
16 explicit NativeWidgetViews(internal::NativeWidgetDelegate* delegate); | 24 NativeWidgetViews(View* host, internal::NativeWidgetDelegate* delegate); |
17 virtual ~NativeWidgetViews(); | 25 virtual ~NativeWidgetViews(); |
18 | 26 |
19 // TODO(beng): remove. | 27 // TODO(beng): remove. |
20 View* GetView(); | 28 View* GetView(); |
21 | 29 |
| 30 internal::NativeWidgetDelegate* delegate() { return delegate_; } |
| 31 |
22 private: | 32 private: |
23 class NativeWidgetView; | |
24 | |
25 // Overridden from NativeWidget: | 33 // Overridden from NativeWidget: |
26 virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; | 34 virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; |
27 virtual Widget* GetWidget() OVERRIDE; | 35 virtual Widget* GetWidget() OVERRIDE; |
28 virtual const Widget* GetWidget() const OVERRIDE; | 36 virtual const Widget* GetWidget() const OVERRIDE; |
29 virtual gfx::NativeView GetNativeView() const OVERRIDE; | 37 virtual gfx::NativeView GetNativeView() const OVERRIDE; |
30 virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE; | 38 virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE; |
31 virtual Window* GetContainingWindow() OVERRIDE; | 39 virtual Window* GetContainingWindow() OVERRIDE; |
32 virtual const Window* GetContainingWindow() const OVERRIDE; | 40 virtual const Window* GetContainingWindow() const OVERRIDE; |
33 virtual void ViewRemoved(View* view) OVERRIDE; | 41 virtual void ViewRemoved(View* view) OVERRIDE; |
34 virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE; | 42 virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE; |
(...skipping 30 matching lines...) Expand all Loading... |
65 const ui::OSExchangeData& data, | 73 const ui::OSExchangeData& data, |
66 int operation) OVERRIDE; | 74 int operation) OVERRIDE; |
67 virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE; | 75 virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE; |
68 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; | 76 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; |
69 | 77 |
70 NativeWidget* GetParentNativeWidget(); | 78 NativeWidget* GetParentNativeWidget(); |
71 const NativeWidget* GetParentNativeWidget() const; | 79 const NativeWidget* GetParentNativeWidget() const; |
72 | 80 |
73 internal::NativeWidgetDelegate* delegate_; | 81 internal::NativeWidgetDelegate* delegate_; |
74 | 82 |
75 NativeWidgetView* view_; | 83 internal::NativeWidgetView* view_; |
| 84 |
| 85 View* host_view_; |
76 | 86 |
77 // The following factory is used for calls to close the NativeWidgetViews | 87 // The following factory is used for calls to close the NativeWidgetViews |
78 // instance. | 88 // instance. |
79 ScopedRunnableMethodFactory<NativeWidgetViews> close_widget_factory_; | 89 ScopedRunnableMethodFactory<NativeWidgetViews> close_widget_factory_; |
80 | 90 |
81 DISALLOW_COPY_AND_ASSIGN(NativeWidgetViews); | 91 DISALLOW_COPY_AND_ASSIGN(NativeWidgetViews); |
82 }; | 92 }; |
83 | 93 |
84 } | 94 } |
85 | 95 |
86 #endif // VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ | 96 #endif // VIEWS_WIDGET_NATIVE_WIDGET_VIEWS_H_ |
OLD | NEW |