| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #if defined(__OBJC__) | 9 #if defined(__OBJC__) |
| 10 | 10 |
| 11 #import <Cocoa/Cocoa.h> | 11 #import <Cocoa/Cocoa.h> |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/memory/scoped_nsobject.h" | 16 #include "base/memory/scoped_nsobject.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "content/browser/tab_contents/tab_contents_view_helper.h" | 18 #include "content/browser/web_contents/web_contents_view_helper.h" |
| 19 #include "content/public/browser/web_contents_view.h" | 19 #include "content/public/browser/web_contents_view.h" |
| 20 #include "ui/base/cocoa/base_view.h" | 20 #include "ui/base/cocoa/base_view.h" |
| 21 #include "ui/gfx/size.h" | 21 #include "ui/gfx/size.h" |
| 22 | 22 |
| 23 @class FocusTracker; | 23 @class FocusTracker; |
| 24 class SkBitmap; | 24 class SkBitmap; |
| 25 class WebContentsViewMac; | 25 class WebContentsViewMac; |
| 26 @class WebDragDest; | 26 @class WebDragDest; |
| 27 @class WebDragSource; | 27 @class WebDragSource; |
| 28 | 28 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 void CloseTab(); | 116 void CloseTab(); |
| 117 | 117 |
| 118 WebContentsImpl* web_contents() { return web_contents_; } | 118 WebContentsImpl* web_contents() { return web_contents_; } |
| 119 content::WebContentsViewDelegate* delegate() { return delegate_.get(); } | 119 content::WebContentsViewDelegate* delegate() { return delegate_.get(); } |
| 120 | 120 |
| 121 private: | 121 private: |
| 122 // The WebContentsImpl whose contents we display. | 122 // The WebContentsImpl whose contents we display. |
| 123 WebContentsImpl* web_contents_; | 123 WebContentsImpl* web_contents_; |
| 124 | 124 |
| 125 // Common implementations of some WebContentsView methods. | 125 // Common implementations of some WebContentsView methods. |
| 126 TabContentsViewHelper tab_contents_view_helper_; | 126 WebContentsViewHelper web_contents_view_helper_; |
| 127 | 127 |
| 128 // The Cocoa NSView that lives in the view hierarchy. | 128 // The Cocoa NSView that lives in the view hierarchy. |
| 129 scoped_nsobject<WebContentsViewCocoa> cocoa_view_; | 129 scoped_nsobject<WebContentsViewCocoa> cocoa_view_; |
| 130 | 130 |
| 131 // 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 |
| 132 // focus returns. | 132 // focus returns. |
| 133 scoped_nsobject<FocusTracker> focus_tracker_; | 133 scoped_nsobject<FocusTracker> focus_tracker_; |
| 134 | 134 |
| 135 // Our optional delegate. | 135 // Our optional delegate. |
| 136 scoped_ptr<content::WebContentsViewDelegate> delegate_; | 136 scoped_ptr<content::WebContentsViewDelegate> delegate_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 148 } | 148 } |
| 149 | 149 |
| 150 namespace web_contents_view_mac { | 150 namespace web_contents_view_mac { |
| 151 // Creates a WebContentsViewMac. Takes ownership of |delegate|. | 151 // Creates a WebContentsViewMac. Takes ownership of |delegate|. |
| 152 CONTENT_EXPORT content::WebContentsView* CreateWebContentsView( | 152 CONTENT_EXPORT content::WebContentsView* CreateWebContentsView( |
| 153 WebContentsImpl* web_contents, | 153 WebContentsImpl* web_contents, |
| 154 content::WebContentsViewDelegate* delegate); | 154 content::WebContentsViewDelegate* delegate); |
| 155 } | 155 } |
| 156 | 156 |
| 157 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MAC_H_ | 157 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MAC_H_ |
| OLD | NEW |