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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/memory/scoped_nsobject.h" | 13 #include "base/mac/scoped_nsobject.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/common/drag_event_source_info.h" | 16 #include "content/common/drag_event_source_info.h" |
17 #include "content/port/browser/render_view_host_delegate_view.h" | 17 #include "content/port/browser/render_view_host_delegate_view.h" |
18 #include "content/port/browser/web_contents_view_port.h" | 18 #include "content/port/browser/web_contents_view_port.h" |
19 #include "ui/base/cocoa/base_view.h" | 19 #include "ui/base/cocoa/base_view.h" |
20 #include "ui/gfx/size.h" | 20 #include "ui/gfx/size.h" |
21 | 21 |
22 @class FocusTracker; | 22 @class FocusTracker; |
23 class SkBitmap; | 23 class SkBitmap; |
24 @class WebDragDest; | 24 @class WebDragDest; |
25 @class WebDragSource; | 25 @class WebDragSource; |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 class WebContentsImpl; | 28 class WebContentsImpl; |
29 class WebContentsViewDelegate; | 29 class WebContentsViewDelegate; |
30 class WebContentsViewMac; | 30 class WebContentsViewMac; |
31 } | 31 } |
32 | 32 |
33 namespace gfx { | 33 namespace gfx { |
34 class Vector2d; | 34 class Vector2d; |
35 } | 35 } |
36 | 36 |
37 CONTENT_EXPORT | 37 CONTENT_EXPORT |
38 @interface WebContentsViewCocoa : BaseView { | 38 @interface WebContentsViewCocoa : BaseView { |
39 @private | 39 @private |
40 content::WebContentsViewMac* webContentsView_; // WEAK; owns us | 40 content::WebContentsViewMac* webContentsView_; // WEAK; owns us |
41 scoped_nsobject<WebDragSource> dragSource_; | 41 base::scoped_nsobject<WebDragSource> dragSource_; |
42 scoped_nsobject<WebDragDest> dragDest_; | 42 base::scoped_nsobject<WebDragDest> dragDest_; |
43 BOOL mouseDownCanMoveWindow_; | 43 BOOL mouseDownCanMoveWindow_; |
44 } | 44 } |
45 | 45 |
46 - (void)setMouseDownCanMoveWindow:(BOOL)canMove; | 46 - (void)setMouseDownCanMoveWindow:(BOOL)canMove; |
47 | 47 |
48 // Expose this, since sometimes one needs both the NSView and the | 48 // Expose this, since sometimes one needs both the NSView and the |
49 // WebContentsImpl. | 49 // WebContentsImpl. |
50 - (content::WebContentsImpl*)webContents; | 50 - (content::WebContentsImpl*)webContents; |
51 @end | 51 @end |
52 | 52 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 void CloseTab(); | 118 void CloseTab(); |
119 | 119 |
120 WebContentsImpl* web_contents() { return web_contents_; } | 120 WebContentsImpl* web_contents() { return web_contents_; } |
121 WebContentsViewDelegate* delegate() { return delegate_.get(); } | 121 WebContentsViewDelegate* delegate() { return delegate_.get(); } |
122 | 122 |
123 private: | 123 private: |
124 // The WebContentsImpl whose contents we display. | 124 // The WebContentsImpl whose contents we display. |
125 WebContentsImpl* web_contents_; | 125 WebContentsImpl* web_contents_; |
126 | 126 |
127 // The Cocoa NSView that lives in the view hierarchy. | 127 // The Cocoa NSView that lives in the view hierarchy. |
128 scoped_nsobject<WebContentsViewCocoa> cocoa_view_; | 128 base::scoped_nsobject<WebContentsViewCocoa> cocoa_view_; |
129 | 129 |
130 // Keeps track of which NSView has focus so we can restore the focus when | 130 // Keeps track of which NSView has focus so we can restore the focus when |
131 // focus returns. | 131 // focus returns. |
132 scoped_nsobject<FocusTracker> focus_tracker_; | 132 base::scoped_nsobject<FocusTracker> focus_tracker_; |
133 | 133 |
134 // Our optional delegate. | 134 // Our optional delegate. |
135 scoped_ptr<WebContentsViewDelegate> delegate_; | 135 scoped_ptr<WebContentsViewDelegate> delegate_; |
136 | 136 |
137 // Whether to allow overlapping views. | 137 // Whether to allow overlapping views. |
138 bool allow_overlapping_views_; | 138 bool allow_overlapping_views_; |
139 | 139 |
140 DISALLOW_COPY_AND_ASSIGN(WebContentsViewMac); | 140 DISALLOW_COPY_AND_ASSIGN(WebContentsViewMac); |
141 }; | 141 }; |
142 | 142 |
143 } // namespace content | 143 } // namespace content |
144 | 144 |
145 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MAC_H_ | 145 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MAC_H_ |
OLD | NEW |