| 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 UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_AURA_H_ | 5 #ifndef UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_AURA_H_ |
| 6 #define UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_AURA_H_ | 6 #define UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_AURA_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| 11 #include "ui/aura/window_observer.h" | 11 #include "ui/aura/window_observer.h" |
| 12 #include "ui/gfx/transform.h" |
| 12 #include "ui/views/controls/native/native_view_host_wrapper.h" | 13 #include "ui/views/controls/native/native_view_host_wrapper.h" |
| 13 #include "ui/views/views_export.h" | 14 #include "ui/views/views_export.h" |
| 14 | 15 |
| 15 namespace views { | 16 namespace views { |
| 16 | 17 |
| 17 class NativeViewHost; | 18 class NativeViewHost; |
| 18 | 19 |
| 19 // Aura implementation of NativeViewHostWrapper. | 20 // Aura implementation of NativeViewHostWrapper. |
| 20 class VIEWS_EXPORT NativeViewHostAura : public NativeViewHostWrapper, | 21 class VIEWS_EXPORT NativeViewHostAura : public NativeViewHostWrapper, |
| 21 public aura::WindowObserver { | 22 public aura::WindowObserver { |
| 22 public: | 23 public: |
| 23 explicit NativeViewHostAura(NativeViewHost* host); | 24 explicit NativeViewHostAura(NativeViewHost* host); |
| 24 ~NativeViewHostAura() override; | 25 ~NativeViewHostAura() override; |
| 25 | 26 |
| 26 // Overridden from NativeViewHostWrapper: | 27 // Overridden from NativeViewHostWrapper: |
| 27 void AttachNativeView() override; | 28 void AttachNativeView() override; |
| 28 void NativeViewDetaching(bool destroyed) override; | 29 void NativeViewDetaching(bool destroyed) override; |
| 29 void AddedToWidget() override; | 30 void AddedToWidget() override; |
| 30 void RemovedFromWidget() override; | 31 void RemovedFromWidget() override; |
| 31 void InstallClip(int x, int y, int w, int h) override; | 32 void InstallClip(int x, int y, int w, int h) override; |
| 32 bool HasInstalledClip() override; | 33 bool HasInstalledClip() override; |
| 33 void UninstallClip() override; | 34 void UninstallClip() override; |
| 34 void ShowWidget(int x, int y, int w, int h) override; | 35 void ShowWidget(int x, int y, int w, int h, int render_w, int render_h) |
| 36 override; |
| 35 void HideWidget() override; | 37 void HideWidget() override; |
| 36 void SetFocus() override; | 38 void SetFocus() override; |
| 37 gfx::NativeViewAccessible GetNativeViewAccessible() override; | 39 gfx::NativeViewAccessible GetNativeViewAccessible() override; |
| 38 gfx::NativeCursor GetCursor(int x, int y) override; | 40 gfx::NativeCursor GetCursor(int x, int y) override; |
| 39 | 41 |
| 40 private: | 42 private: |
| 41 friend class NativeViewHostAuraTest; | 43 friend class NativeViewHostAuraTest; |
| 42 | 44 |
| 43 class ClippingWindowDelegate; | 45 class ClippingWindowDelegate; |
| 44 | 46 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 58 NativeViewHost* host_; | 60 NativeViewHost* host_; |
| 59 | 61 |
| 60 std::unique_ptr<ClippingWindowDelegate> clipping_window_delegate_; | 62 std::unique_ptr<ClippingWindowDelegate> clipping_window_delegate_; |
| 61 | 63 |
| 62 // Window that exists between the native view and the parent that allows for | 64 // Window that exists between the native view and the parent that allows for |
| 63 // clipping to occur. This is positioned in the coordinate space of | 65 // clipping to occur. This is positioned in the coordinate space of |
| 64 // host_->GetWidget(). | 66 // host_->GetWidget(). |
| 65 aura::Window clipping_window_; | 67 aura::Window clipping_window_; |
| 66 std::unique_ptr<gfx::Rect> clip_rect_; | 68 std::unique_ptr<gfx::Rect> clip_rect_; |
| 67 | 69 |
| 70 // Set when AttachNativeView() is called. This is the original transform of |
| 71 // the NativeView's layer. The NativeView's layer may be modified to scale |
| 72 // when ShowWidget() is called with a rendering size not equal to the region's |
| 73 // size. When NativeViewDetaching() is called, the NativeView's |
| 74 // transform is restored to this. |
| 75 gfx::Transform original_transform_; |
| 76 |
| 68 DISALLOW_COPY_AND_ASSIGN(NativeViewHostAura); | 77 DISALLOW_COPY_AND_ASSIGN(NativeViewHostAura); |
| 69 }; | 78 }; |
| 70 | 79 |
| 71 } // namespace views | 80 } // namespace views |
| 72 | 81 |
| 73 #endif // UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_AURA_H_ | 82 #endif // UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_AURA_H_ |
| OLD | NEW |