Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Side by Side Diff: ui/views/controls/native/native_view_host_mac.h

Issue 2654413002: Stretching NativeViewHost, and misc tab capture fixes.
Patch Set: Gettin' it all working on ui/cocoa and MacViews too. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_MAC_H_ 5 #ifndef UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_MAC_H_
6 #define UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_MAC_H_ 6 #define UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_MAC_H_
7 7
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "ui/views/controls/native/native_view_host_wrapper.h" 10 #include "ui/views/controls/native/native_view_host_wrapper.h"
11 #include "ui/views/views_export.h" 11 #include "ui/views/views_export.h"
12 12
13 @class NativeViewHostMacScalingView;
14
13 namespace views { 15 namespace views {
14 16
15 class NativeViewHost; 17 class NativeViewHost;
16 18
17 // Mac implementation of NativeViewHostWrapper. 19 // Mac implementation of NativeViewHostWrapper.
18 class VIEWS_EXPORT NativeViewHostMac : public NativeViewHostWrapper { 20 class VIEWS_EXPORT NativeViewHostMac : public NativeViewHostWrapper {
19 public: 21 public:
20 explicit NativeViewHostMac(NativeViewHost* host); 22 explicit NativeViewHostMac(NativeViewHost* host);
21 ~NativeViewHostMac() override; 23 ~NativeViewHostMac() override;
22 24
23 // Overridden from NativeViewHostWrapper: 25 // Overridden from NativeViewHostWrapper:
24 void AttachNativeView() override; 26 void AttachNativeView() override;
25 void NativeViewDetaching(bool destroyed) override; 27 void NativeViewDetaching(bool destroyed) override;
26 void AddedToWidget() override; 28 void AddedToWidget() override;
27 void RemovedFromWidget() override; 29 void RemovedFromWidget() override;
28 void InstallClip(int x, int y, int w, int h) override; 30 void InstallClip(int x, int y, int w, int h) override;
29 bool HasInstalledClip() override; 31 bool HasInstalledClip() override;
30 void UninstallClip() override; 32 void UninstallClip() override;
31 void ShowWidget(int x, int y, int w, int h) override; 33 void ShowWidget(int x, int y, int w, int h, int render_w, int render_h)
34 override;
32 void HideWidget() override; 35 void HideWidget() override;
33 void SetFocus() override; 36 void SetFocus() override;
34 gfx::NativeViewAccessible GetNativeViewAccessible() override; 37 gfx::NativeViewAccessible GetNativeViewAccessible() override;
35 gfx::NativeCursor GetCursor(int x, int y) override; 38 gfx::NativeCursor GetCursor(int x, int y) override;
36 39
37 private: 40 private:
38 // Our associated NativeViewHost. Owns this. 41 // Our associated NativeViewHost. Owns this.
39 NativeViewHost* host_; 42 NativeViewHost* host_;
40 43
41 // Retain the native view as it may be destroyed at an unpredictable time. 44 // Set when AttachNativeView() is called. This provides a scaling transform
42 base::scoped_nsobject<NSView> native_view_; 45 // when ShowWidget() is called with a rendering size not equal to the region's
46 // size. When NativeViewDetaching() is called, this is destroyed.
47 base::scoped_nsobject<NativeViewHostMacScalingView> scaling_view_;
43 48
44 DISALLOW_COPY_AND_ASSIGN(NativeViewHostMac); 49 DISALLOW_COPY_AND_ASSIGN(NativeViewHostMac);
45 }; 50 };
46 51
47 } // namespace views 52 } // namespace views
48 53
49 #endif // UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_AURA_H_ 54 #endif // UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_AURA_H_
OLDNEW
« no previous file with comments | « ui/views/controls/native/native_view_host_aura_unittest.cc ('k') | ui/views/controls/native/native_view_host_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698