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

Unified Diff: ui/views/cocoa/bridged_content_view.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/ui_base.gyp ('k') | ui/views/cocoa/bridged_content_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_content_view.h
diff --git a/ui/views/cocoa/bridged_content_view.h b/ui/views/cocoa/bridged_content_view.h
index 0d84c779483eaa2ecd31e9def7cd0b73c4826c8f..969af9975a1997862949dffe3a31086e7527e380 100644
--- a/ui/views/cocoa/bridged_content_view.h
+++ b/ui/views/cocoa/bridged_content_view.h
@@ -7,6 +7,8 @@
#import <Cocoa/Cocoa.h>
+#include "base/strings/string16.h"
+#import "ui/base/cocoa/tool_tip_base_view.h"
#import "ui/base/cocoa/tracking_area.h"
namespace ui {
@@ -21,7 +23,7 @@ class View;
// a views::RootView present. Bridges requests from Cocoa to the hosted
// views::View.
@interface BridgedContentView
- : NSView<NSTextInputClient, NSUserInterfaceValidations> {
+ : ToolTipBaseView<NSTextInputClient, NSUserInterfaceValidations> {
@private
// Weak. The hosted RootView, owned by hostedView_->GetWidget().
views::View* hostedView_;
@@ -31,10 +33,13 @@ class View;
ui::TextInputClient* textInputClient_;
// A tracking area installed to enable mouseMoved events.
- ui::ScopedCrTrackingArea trackingArea_;
+ ui::ScopedCrTrackingArea cursorTrackingArea_;
// Whether the view is reacting to a keyDown event on the view.
BOOL inKeyDown_;
+
+ // The last tooltip text, used to limit updates.
+ base::string16 lastTooltipText_;
}
@property(readonly, nonatomic) views::View* hostedView;
@@ -49,6 +54,12 @@ class View;
// Process a mouse event captured while the widget had global mouse capture.
- (void)processCapturedMouseEvent:(NSEvent*)theEvent;
+// Mac's version of views::corewm::TooltipController::UpdateIfRequired().
+// Updates the tooltip on the ToolTipBaseView if the text needs to change.
+// |locationInContent| is the position from the top left of the window's
+// contentRect (also this NSView's frame), as given by a ui::LocatedEvent.
+- (void)updateTooltipIfRequiredAt:(const gfx::Point&)locationInContent;
+
@end
#endif // UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_
« no previous file with comments | « ui/base/ui_base.gyp ('k') | ui/views/cocoa/bridged_content_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698