| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef VIEWS_CONTROLS_NATIVE_CONTROL_WIN_H_ | 5 #ifndef VIEWS_CONTROLS_NATIVE_CONTROL_WIN_H_ |
| 6 #define VIEWS_CONTROLS_NATIVE_CONTROL_WIN_H_ | 6 #define VIEWS_CONTROLS_NATIVE_CONTROL_WIN_H_ |
| 7 | 7 |
| 8 #include "views/controls/hwnd_view.h" | 8 #include "views/controls/native/native_view_host.h" |
| 9 | 9 |
| 10 namespace views { | 10 namespace views { |
| 11 | 11 |
| 12 // A View that hosts a native Windows control. | 12 // A View that hosts a native Windows control. |
| 13 class NativeControlWin : public HWNDView { | 13 class NativeControlWin : public NativeViewHost { |
| 14 public: | 14 public: |
| 15 static const wchar_t* kNativeControlWinKey; | 15 static const wchar_t* kNativeControlWinKey; |
| 16 | 16 |
| 17 NativeControlWin(); | 17 NativeControlWin(); |
| 18 virtual ~NativeControlWin(); | 18 virtual ~NativeControlWin(); |
| 19 | 19 |
| 20 // Called by the containing WidgetWin when a message is received from the HWND | 20 // Called by the containing WidgetWin when a message is received from the HWND |
| 21 // created by an object derived from NativeControlWin. Derived classes MUST | 21 // created by an object derived from NativeControlWin. Derived classes MUST |
| 22 // call _this_ version of the function if they override it and do not handle | 22 // call _this_ version of the function if they override it and do not handle |
| 23 // all of the messages listed in widget_win.cc ProcessNativeControlWinMessage. | 23 // all of the messages listed in widget_win.cc ProcessNativeControlWinMessage. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 53 // has been created. | 53 // has been created. |
| 54 virtual bool NotifyOnKeyDown() const { return false; } | 54 virtual bool NotifyOnKeyDown() const { return false; } |
| 55 | 55 |
| 56 // Called when the NativeControlWin is attached to a View hierarchy with a | 56 // Called when the NativeControlWin is attached to a View hierarchy with a |
| 57 // valid Widget. The NativeControlWin should use this opportunity to create | 57 // valid Widget. The NativeControlWin should use this opportunity to create |
| 58 // its associated HWND. | 58 // its associated HWND. |
| 59 virtual void CreateNativeControl() = 0; | 59 virtual void CreateNativeControl() = 0; |
| 60 | 60 |
| 61 // MUST be called by the subclass implementation of |CreateNativeControl| | 61 // MUST be called by the subclass implementation of |CreateNativeControl| |
| 62 // immediately after creating the control HWND, otherwise it won't be attached | 62 // immediately after creating the control HWND, otherwise it won't be attached |
| 63 // to the HWNDView and will be effectively orphaned. | 63 // to the NativeViewHost and will be effectively orphaned. |
| 64 virtual void NativeControlCreated(HWND native_control); | 64 virtual void NativeControlCreated(HWND native_control); |
| 65 | 65 |
| 66 // Returns additional extended style flags. When subclasses call | 66 // Returns additional extended style flags. When subclasses call |
| 67 // CreateWindowEx in order to create the underlying control, they must OR the | 67 // CreateWindowEx in order to create the underlying control, they must OR the |
| 68 // ExStyle parameter with the value returned by this function. | 68 // ExStyle parameter with the value returned by this function. |
| 69 // | 69 // |
| 70 // We currently use this method in order to add flags such as WS_EX_LAYOUTRTL | 70 // We currently use this method in order to add flags such as WS_EX_LAYOUTRTL |
| 71 // to the HWND for views with right-to-left UI layout. | 71 // to the HWND for views with right-to-left UI layout. |
| 72 DWORD GetAdditionalExStyle() const; | 72 DWORD GetAdditionalExStyle() const; |
| 73 | 73 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 91 | 91 |
| 92 // The window procedure before we subclassed. | 92 // The window procedure before we subclassed. |
| 93 static WNDPROC original_wndproc_; | 93 static WNDPROC original_wndproc_; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(NativeControlWin); | 95 DISALLOW_COPY_AND_ASSIGN(NativeControlWin); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace views | 98 } // namespace views |
| 99 | 99 |
| 100 #endif // #ifndef VIEWS_CONTROLS_NATIVE_CONTROL_WIN_H_ | 100 #endif // #ifndef VIEWS_CONTROLS_NATIVE_CONTROL_WIN_H_ |
| OLD | NEW |