| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_CONTROL_NATIVE_NATIVE_VIEW_HOST_WIN_H_ | 5 #ifndef VIEWS_CONTROLS_HWND_VIEW_H_ |
| 6 #define VIEWS_CONTROL_NATIVE_NATIVE_VIEW_HOST_WIN_H_ | 6 #define VIEWS_CONTROLS_HWND_VIEW_H_ |
| 7 | |
| 8 #include "windows.h" | |
| 9 | 7 |
| 10 #include "base/logging.h" | 8 #include "base/logging.h" |
| 11 #include "views/controls/native/native_view_host_wrapper.h" | 9 #include "views/controls/native/native_view_host_wrapper.h" |
| 12 | 10 |
| 13 namespace views { | 11 namespace views { |
| 14 | 12 |
| 15 class NativeViewHost; | 13 class NativeViewHost; |
| 16 | 14 |
| 17 // A Windows implementation of NativeViewHostWrapper | 15 // A Windows implementation of NativeViewHostWrapper |
| 18 class NativeViewHostWin : public NativeViewHostWrapper { | 16 class NativeViewHostWin : public NativeViewHostWrapper { |
| 19 public: | 17 public: |
| 20 explicit NativeViewHostWin(NativeViewHost* host); | 18 explicit NativeViewHostWin(NativeViewHost* host); |
| 21 virtual ~NativeViewHostWin(); | 19 virtual ~NativeViewHostWin(); |
| 22 | 20 |
| 23 // Overridden from NativeViewHostWrapper: | 21 // Overridden from NativeViewHostWrapper: |
| 24 virtual void NativeViewAttached(); | 22 virtual void NativeViewAttached(); |
| 25 virtual void NativeViewDetaching(); | 23 virtual void NativeViewDetaching(); |
| 26 virtual void AddedToWidget(); | 24 virtual void AddedToWidget(); |
| 27 virtual void RemovedFromWidget(); | 25 virtual void RemovedFromWidget(); |
| 28 virtual void InstallClip(int x, int y, int w, int h); | 26 virtual void InstallClip(int x, int y, int w, int h); |
| 29 virtual bool HasInstalledClip(); | 27 virtual bool HasInstalledClip(); |
| 30 virtual void UninstallClip(); | 28 virtual void UninstallClip(); |
| 31 virtual void ShowWidget(int x, int y, int w, int h); | 29 virtual void ShowWidget(int x, int y, int w, int h); |
| 32 virtual void HideWidget(); | 30 virtual void HideWidget(); |
| 31 virtual void SetFocus(); |
| 33 | 32 |
| 34 private: | 33 private: |
| 35 // Our subclass window procedure. | |
| 36 static LRESULT CALLBACK NativeViewHostWndProc(HWND window, | |
| 37 UINT message, | |
| 38 WPARAM w_param, | |
| 39 LPARAM l_param); | |
| 40 | |
| 41 // Our associated NativeViewHost. | 34 // Our associated NativeViewHost. |
| 42 NativeViewHost* host_; | 35 NativeViewHost* host_; |
| 43 | 36 |
| 44 // Have we installed a region on the gfx::NativeView used to clip to only the | 37 // Have we installed a region on the gfx::NativeView used to clip to only the |
| 45 // visible portion of the gfx::NativeView ? | 38 // visible portion of the gfx::NativeView ? |
| 46 bool installed_clip_; | 39 bool installed_clip_; |
| 47 | 40 |
| 48 // The window procedure before we subclassed. | |
| 49 WNDPROC original_wndproc_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(NativeViewHostWin); | 41 DISALLOW_COPY_AND_ASSIGN(NativeViewHostWin); |
| 52 }; | 42 }; |
| 53 | 43 |
| 54 } // namespace views | 44 } // namespace views |
| 55 | 45 |
| 56 #endif // VIEWS_CONTROL_NATIVE_NATIVE_VIEW_HOST_WIN_H_ | 46 #endif // VIEWS_CONTROLS_HWND_VIEW_H_ |
| OLD | NEW |