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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.h

Issue 1137653005: MacViews: Implement Tooltips (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: respond to comments Created 5 years, 7 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 (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_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <IOSurface/IOSurfaceAPI.h> 9 #include <IOSurface/IOSurfaceAPI.h>
10 #include <list> 10 #include <list>
(...skipping 13 matching lines...) Expand all
24 #include "content/browser/renderer_host/input/mouse_wheel_rails_filter_mac.h" 24 #include "content/browser/renderer_host/input/mouse_wheel_rails_filter_mac.h"
25 #include "content/browser/renderer_host/render_widget_host_view_base.h" 25 #include "content/browser/renderer_host/render_widget_host_view_base.h"
26 #include "content/common/content_export.h" 26 #include "content/common/content_export.h"
27 #include "content/common/cursors/webcursor.h" 27 #include "content/common/cursors/webcursor.h"
28 #include "content/common/edit_command.h" 28 #include "content/common/edit_command.h"
29 #import "content/public/browser/render_widget_host_view_mac_base.h" 29 #import "content/public/browser/render_widget_host_view_mac_base.h"
30 #include "ipc/ipc_sender.h" 30 #include "ipc/ipc_sender.h"
31 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" 31 #include "third_party/WebKit/public/web/WebCompositionUnderline.h"
32 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" 32 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
33 #include "ui/accelerated_widget_mac/io_surface_layer.h" 33 #include "ui/accelerated_widget_mac/io_surface_layer.h"
34 #include "ui/base/cocoa/base_view.h"
35 #include "ui/base/cocoa/remote_layer_api.h" 34 #include "ui/base/cocoa/remote_layer_api.h"
35 #import "ui/base/cocoa/tool_tip_base_view.h"
36 #include "ui/gfx/display_observer.h" 36 #include "ui/gfx/display_observer.h"
37 37
38 namespace content { 38 namespace content {
39 class RenderWidgetHostImpl; 39 class RenderWidgetHostImpl;
40 class RenderWidgetHostViewMac; 40 class RenderWidgetHostViewMac;
41 class RenderWidgetHostViewMacEditCommandHelper; 41 class RenderWidgetHostViewMacEditCommandHelper;
42 class WebContents; 42 class WebContents;
43 } 43 }
44 44
45 namespace ui { 45 namespace ui {
46 class Compositor; 46 class Compositor;
47 class Layer; 47 class Layer;
48 } 48 }
49 49
50 @class FullscreenWindowManager; 50 @class FullscreenWindowManager;
51 @protocol RenderWidgetHostViewMacDelegate; 51 @protocol RenderWidgetHostViewMacDelegate;
52 @class ToolTip;
53 52
54 @protocol RenderWidgetHostViewMacOwner 53 @protocol RenderWidgetHostViewMacOwner
55 - (content::RenderWidgetHostViewMac*)renderWidgetHostViewMac; 54 - (content::RenderWidgetHostViewMac*)renderWidgetHostViewMac;
56 @end 55 @end
57 56
58 // This is the view that lives in the Cocoa view hierarchy. In Windows-land, 57 // This is the view that lives in the Cocoa view hierarchy. In Windows-land,
59 // RenderWidgetHostViewWin is both the view and the delegate. We split the roles 58 // RenderWidgetHostViewWin is both the view and the delegate. We split the roles
60 // but that means that the view needs to own the delegate and will dispose of it 59 // but that means that the view needs to own the delegate and will dispose of it
61 // when it's removed from the view system. 60 // when it's removed from the view system.
62 @interface RenderWidgetHostViewCocoa 61 @interface RenderWidgetHostViewCocoa
63 : BaseView <RenderWidgetHostViewMacBase, 62 : ToolTipBaseView<RenderWidgetHostViewMacBase,
64 RenderWidgetHostViewMacOwner, 63 RenderWidgetHostViewMacOwner,
65 NSTextInputClient> { 64 NSTextInputClient> {
66 @private 65 @private
67 scoped_ptr<content::RenderWidgetHostViewMac> renderWidgetHostView_; 66 scoped_ptr<content::RenderWidgetHostViewMac> renderWidgetHostView_;
68 // This ivar is the cocoa delegate of the NSResponder. 67 // This ivar is the cocoa delegate of the NSResponder.
69 base::scoped_nsobject<NSObject<RenderWidgetHostViewMacDelegate>> 68 base::scoped_nsobject<NSObject<RenderWidgetHostViewMacDelegate>>
70 responderDelegate_; 69 responderDelegate_;
71 BOOL canBeKeyView_; 70 BOOL canBeKeyView_;
72 BOOL closeOnDeactivate_; 71 BOOL closeOnDeactivate_;
73 BOOL opaque_; 72 BOOL opaque_;
74 scoped_ptr<content::RenderWidgetHostViewMacEditCommandHelper> 73 scoped_ptr<content::RenderWidgetHostViewMacEditCommandHelper>
75 editCommand_helper_; 74 editCommand_helper_;
76 75
77 // These are part of the magic tooltip code from WebKit's WebHTMLView:
78 id trackingRectOwner_; // (not retained)
79 void* trackingRectUserData_;
80 NSTrackingRectTag lastToolTipTag_;
81 base::scoped_nsobject<NSString> toolTip_;
82
83 // Is YES if there was a mouse-down as yet unbalanced with a mouse-up. 76 // Is YES if there was a mouse-down as yet unbalanced with a mouse-up.
84 BOOL hasOpenMouseDown_; 77 BOOL hasOpenMouseDown_;
85 78
86 NSWindow* lastWindow_; // weak 79 NSWindow* lastWindow_; // weak
87 80
88 // The cursor for the page. This is passed up from the renderer. 81 // The cursor for the page. This is passed up from the renderer.
89 base::scoped_nsobject<NSCursor> currentCursor_; 82 base::scoped_nsobject<NSCursor> currentCursor_;
90 83
91 // Variables used by our implementaion of the NSTextInput protocol. 84 // Variables used by our implementaion of the NSTextInput protocol.
92 // An input method of Mac calls the methods of this protocol not only to 85 // An input method of Mac calls the methods of this protocol not only to
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 // orientation. 180 // orientation.
188 content::MouseWheelRailsFilterMac mouseWheelFilter_; 181 content::MouseWheelRailsFilterMac mouseWheelFilter_;
189 } 182 }
190 183
191 @property(nonatomic, readonly) NSRange selectedRange; 184 @property(nonatomic, readonly) NSRange selectedRange;
192 @property(nonatomic, readonly) BOOL suppressNextEscapeKeyUp; 185 @property(nonatomic, readonly) BOOL suppressNextEscapeKeyUp;
193 186
194 - (void)setCanBeKeyView:(BOOL)can; 187 - (void)setCanBeKeyView:(BOOL)can;
195 - (void)setCloseOnDeactivate:(BOOL)b; 188 - (void)setCloseOnDeactivate:(BOOL)b;
196 - (void)setOpaque:(BOOL)opaque; 189 - (void)setOpaque:(BOOL)opaque;
197 - (void)setToolTipAtMousePoint:(NSString *)string;
198 // True for always-on-top special windows (e.g. Balloons and Panels). 190 // True for always-on-top special windows (e.g. Balloons and Panels).
199 - (BOOL)acceptsMouseEventsWhenInactive; 191 - (BOOL)acceptsMouseEventsWhenInactive;
200 // Cancel ongoing composition (abandon the marked text). 192 // Cancel ongoing composition (abandon the marked text).
201 - (void)cancelComposition; 193 - (void)cancelComposition;
202 // Confirm ongoing composition. 194 // Confirm ongoing composition.
203 - (void)confirmComposition; 195 - (void)confirmComposition;
204 // Enables or disables plugin IME. 196 // Enables or disables plugin IME.
205 - (void)setPluginImeActive:(BOOL)active; 197 - (void)setPluginImeActive:(BOOL)active;
206 // Updates the current plugin focus state. 198 // Updates the current plugin focus state.
207 - (void)pluginFocusChanged:(BOOL)focused forPlugin:(int)pluginId; 199 - (void)pluginFocusChanged:(BOOL)focused forPlugin:(int)pluginId;
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 583
592 // Factory used to safely scope delayed calls to ShutdownHost(). 584 // Factory used to safely scope delayed calls to ShutdownHost().
593 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; 585 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_;
594 586
595 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); 587 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
596 }; 588 };
597 589
598 } // namespace content 590 } // namespace content
599 591
600 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 592 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
OLDNEW
« no previous file with comments | « android_webview/tools/third_party_files_whitelist.txt ('k') | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698