| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/scoped_nsobject.h" | 10 #include "base/scoped_nsobject.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 @end | 25 @end |
| 26 | 26 |
| 27 // This is the view that lives in the Cocoa view hierarchy. In Windows-land, | 27 // This is the view that lives in the Cocoa view hierarchy. In Windows-land, |
| 28 // RenderWidgetHostViewWin is both the view and the delegate. We split the roles | 28 // RenderWidgetHostViewWin is both the view and the delegate. We split the roles |
| 29 // but that means that the view needs to own the delegate and will dispose of it | 29 // but that means that the view needs to own the delegate and will dispose of it |
| 30 // when it's removed from the view system. | 30 // when it's removed from the view system. |
| 31 | 31 |
| 32 @interface RenderWidgetHostViewCocoa | 32 @interface RenderWidgetHostViewCocoa |
| 33 : BaseView <RenderWidgetHostViewMacOwner, NSTextInput, NSChangeSpelling> { | 33 : BaseView <RenderWidgetHostViewMacOwner, NSTextInput, NSChangeSpelling> { |
| 34 @private | 34 @private |
| 35 RenderWidgetHostViewMac* renderWidgetHostView_; | 35 RenderWidgetHostViewMac* renderWidgetHostView_; // Owned by us. |
| 36 BOOL canBeKeyView_; | 36 BOOL canBeKeyView_; |
| 37 BOOL closeOnDeactivate_; | 37 BOOL closeOnDeactivate_; |
| 38 scoped_ptr<RWHVMEditCommandHelper> editCommand_helper_; | 38 scoped_ptr<RWHVMEditCommandHelper> editCommand_helper_; |
| 39 | 39 |
| 40 // These are part of the magic tooltip code from WebKit's WebHTMLView: | 40 // These are part of the magic tooltip code from WebKit's WebHTMLView: |
| 41 id trackingRectOwner_; // (not retained) | 41 id trackingRectOwner_; // (not retained) |
| 42 void *trackingRectUserData_; | 42 void *trackingRectUserData_; |
| 43 NSTrackingRectTag lastToolTipTag_; | 43 NSTrackingRectTag lastToolTipTag_; |
| 44 NSString* toolTip_; | 44 NSString* toolTip_; |
| 45 } | 45 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 virtual void Destroy(); | 100 virtual void Destroy(); |
| 101 virtual void SetTooltipText(const std::wstring& tooltip_text); | 101 virtual void SetTooltipText(const std::wstring& tooltip_text); |
| 102 virtual BackingStore* AllocBackingStore(const gfx::Size& size); | 102 virtual BackingStore* AllocBackingStore(const gfx::Size& size); |
| 103 virtual void ShowPopupWithItems(gfx::Rect bounds, | 103 virtual void ShowPopupWithItems(gfx::Rect bounds, |
| 104 int item_height, | 104 int item_height, |
| 105 int selected_item, | 105 int selected_item, |
| 106 const std::vector<WebMenuItem>& items); | 106 const std::vector<WebMenuItem>& items); |
| 107 virtual gfx::Rect GetWindowRect(); | 107 virtual gfx::Rect GetWindowRect(); |
| 108 virtual gfx::Rect GetRootWindowRect(); | 108 virtual gfx::Rect GetRootWindowRect(); |
| 109 virtual void SetActive(bool active); | 109 virtual void SetActive(bool active); |
| 110 virtual void SetBackground(const SkBitmap& background); |
| 110 | 111 |
| 111 void KillSelf(); | 112 void KillSelf(); |
| 112 | 113 |
| 113 void set_parent_view(BaseView* parent_view) { parent_view_ = parent_view; } | 114 void set_parent_view(BaseView* parent_view) { parent_view_ = parent_view; } |
| 114 | 115 |
| 115 // These member variables should be private, but the associated ObjC class | 116 // These member variables should be private, but the associated ObjC class |
| 116 // needs access to them and can't be made a friend. | 117 // needs access to them and can't be made a friend. |
| 117 | 118 |
| 118 // The associated Model. Can be NULL if Destroy() is called when | 119 // The associated Model. Can be NULL if Destroy() is called when |
| 119 // someone (other than superview) has retained |cocoa_view_|. | 120 // someone (other than superview) has retained |cocoa_view_|. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // Factory used to safely scope delayed calls to ShutdownHost(). | 202 // Factory used to safely scope delayed calls to ShutdownHost(). |
| 202 ScopedRunnableMethodFactory<RenderWidgetHostViewMac> shutdown_factory_; | 203 ScopedRunnableMethodFactory<RenderWidgetHostViewMac> shutdown_factory_; |
| 203 | 204 |
| 204 // Used for positioning a popup menu. | 205 // Used for positioning a popup menu. |
| 205 BaseView* parent_view_; | 206 BaseView* parent_view_; |
| 206 | 207 |
| 207 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 208 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
| 208 }; | 209 }; |
| 209 | 210 |
| 210 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 211 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| OLD | NEW |