OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MAC_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MAC_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MAC_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MAC_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 virtual void GetContainerBounds(gfx::Rect* out) const OVERRIDE; | 72 virtual void GetContainerBounds(gfx::Rect* out) const OVERRIDE; |
73 virtual void SizeContents(const gfx::Size& size) OVERRIDE; | 73 virtual void SizeContents(const gfx::Size& size) OVERRIDE; |
74 virtual void Focus() OVERRIDE; | 74 virtual void Focus() OVERRIDE; |
75 virtual void SetInitialFocus() OVERRIDE; | 75 virtual void SetInitialFocus() OVERRIDE; |
76 virtual void StoreFocus() OVERRIDE; | 76 virtual void StoreFocus() OVERRIDE; |
77 virtual void RestoreFocus() OVERRIDE; | 77 virtual void RestoreFocus() OVERRIDE; |
78 virtual DropData* GetDropData() const OVERRIDE; | 78 virtual DropData* GetDropData() const OVERRIDE; |
79 virtual gfx::Rect GetViewBounds() const OVERRIDE; | 79 virtual gfx::Rect GetViewBounds() const OVERRIDE; |
80 virtual void SetAllowOverlappingViews(bool overlapping) OVERRIDE; | 80 virtual void SetAllowOverlappingViews(bool overlapping) OVERRIDE; |
81 virtual bool GetAllowOverlappingViews() const OVERRIDE; | 81 virtual bool GetAllowOverlappingViews() const OVERRIDE; |
82 virtual void SetOverlayView(WebContentsView* overlay, | 82 virtual void SetAllowOtherViews(bool allow) OVERRIDE; |
83 const gfx::Point& offset) OVERRIDE; | 83 virtual bool GetAllowOtherViews() const OVERRIDE; |
84 virtual void RemoveOverlayView() OVERRIDE; | |
85 virtual void CreateView( | 84 virtual void CreateView( |
86 const gfx::Size& initial_size, gfx::NativeView context) OVERRIDE; | 85 const gfx::Size& initial_size, gfx::NativeView context) OVERRIDE; |
87 virtual RenderWidgetHostViewBase* CreateViewForWidget( | 86 virtual RenderWidgetHostViewBase* CreateViewForWidget( |
88 RenderWidgetHost* render_widget_host) OVERRIDE; | 87 RenderWidgetHost* render_widget_host) OVERRIDE; |
89 virtual RenderWidgetHostViewBase* CreateViewForPopupWidget( | 88 virtual RenderWidgetHostViewBase* CreateViewForPopupWidget( |
90 RenderWidgetHost* render_widget_host) OVERRIDE; | 89 RenderWidgetHost* render_widget_host) OVERRIDE; |
91 virtual void SetPageTitle(const base::string16& title) OVERRIDE; | 90 virtual void SetPageTitle(const base::string16& title) OVERRIDE; |
92 virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; | 91 virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; |
93 virtual void RenderViewSwappedIn(RenderViewHost* host) OVERRIDE; | 92 virtual void RenderViewSwappedIn(RenderViewHost* host) OVERRIDE; |
94 virtual void SetOverscrollControllerEnabled(bool enabled) OVERRIDE; | 93 virtual void SetOverscrollControllerEnabled(bool enabled) OVERRIDE; |
(...skipping 21 matching lines...) Expand all Loading... |
116 virtual void TakeFocus(bool reverse) OVERRIDE; | 115 virtual void TakeFocus(bool reverse) OVERRIDE; |
117 | 116 |
118 // A helper method for closing the tab in the | 117 // A helper method for closing the tab in the |
119 // CloseTabAfterEventTracking() implementation. | 118 // CloseTabAfterEventTracking() implementation. |
120 void CloseTab(); | 119 void CloseTab(); |
121 | 120 |
122 WebContentsImpl* web_contents() { return web_contents_; } | 121 WebContentsImpl* web_contents() { return web_contents_; } |
123 WebContentsViewDelegate* delegate() { return delegate_.get(); } | 122 WebContentsViewDelegate* delegate() { return delegate_.get(); } |
124 | 123 |
125 private: | 124 private: |
126 // Updates overlay view on current RenderWidgetHostView. | |
127 void UpdateRenderWidgetHostViewOverlay(); | |
128 | |
129 // The WebContentsImpl whose contents we display. | 125 // The WebContentsImpl whose contents we display. |
130 WebContentsImpl* web_contents_; | 126 WebContentsImpl* web_contents_; |
131 | 127 |
132 // The Cocoa NSView that lives in the view hierarchy. | 128 // The Cocoa NSView that lives in the view hierarchy. |
133 base::scoped_nsobject<WebContentsViewCocoa> cocoa_view_; | 129 base::scoped_nsobject<WebContentsViewCocoa> cocoa_view_; |
134 | 130 |
135 // Keeps track of which NSView has focus so we can restore the focus when | 131 // Keeps track of which NSView has focus so we can restore the focus when |
136 // focus returns. | 132 // focus returns. |
137 base::scoped_nsobject<FocusTracker> focus_tracker_; | 133 base::scoped_nsobject<FocusTracker> focus_tracker_; |
138 | 134 |
139 // Our optional delegate. | 135 // Our optional delegate. |
140 scoped_ptr<WebContentsViewDelegate> delegate_; | 136 scoped_ptr<WebContentsViewDelegate> delegate_; |
141 | 137 |
142 // Whether to allow overlapping views. | 138 // Whether to allow overlapping views. |
143 bool allow_overlapping_views_; | 139 bool allow_overlapping_views_; |
144 | 140 |
145 // The overlay view which is rendered above this one. | 141 // Whether to allow other views. |
146 // Overlay view has |underlay_view_| set to this view. | 142 bool allow_other_views_; |
147 WebContentsViewMac* overlay_view_; | |
148 | |
149 // The offset of overlay view relative to this view. | |
150 gfx::Point overlay_view_offset_; | |
151 | |
152 // The underlay view which this view is rendered above. | |
153 // Underlay view has |overlay_view_| set to this view. | |
154 WebContentsViewMac* underlay_view_; | |
155 | 143 |
156 scoped_ptr<PopupMenuHelper> popup_menu_helper_; | 144 scoped_ptr<PopupMenuHelper> popup_menu_helper_; |
157 | 145 |
158 DISALLOW_COPY_AND_ASSIGN(WebContentsViewMac); | 146 DISALLOW_COPY_AND_ASSIGN(WebContentsViewMac); |
159 }; | 147 }; |
160 | 148 |
161 } // namespace content | 149 } // namespace content |
162 | 150 |
163 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MAC_H_ | 151 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MAC_H_ |
OLD | NEW |