OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_ | 5 #ifndef UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_ |
6 #define UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_ | 6 #define UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
| 10 #import "base/mac/scoped_nsobject.h" |
10 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
11 #import "ui/base/cocoa/tool_tip_base_view.h" | 12 #import "ui/base/cocoa/tool_tip_base_view.h" |
12 #import "ui/base/cocoa/tracking_area.h" | 13 #import "ui/base/cocoa/tracking_area.h" |
13 | 14 |
14 namespace ui { | 15 namespace ui { |
15 class TextInputClient; | 16 class TextInputClient; |
16 } | 17 } |
17 | 18 |
18 namespace views { | 19 namespace views { |
19 class View; | 20 class View; |
20 } | 21 } |
21 | 22 |
22 // The NSView that sits as the root contentView of the NSWindow, whilst it has | 23 // The NSView that sits as the root contentView of the NSWindow, whilst it has |
23 // a views::RootView present. Bridges requests from Cocoa to the hosted | 24 // a views::RootView present. Bridges requests from Cocoa to the hosted |
24 // views::View. | 25 // views::View. |
25 @interface BridgedContentView | 26 @interface BridgedContentView |
26 : ToolTipBaseView<NSTextInputClient, NSUserInterfaceValidations> { | 27 : ToolTipBaseView<NSTextInputClient, NSUserInterfaceValidations> { |
27 @private | 28 @private |
28 // Weak. The hosted RootView, owned by hostedView_->GetWidget(). | 29 // Weak. The hosted RootView, owned by hostedView_->GetWidget(). |
29 views::View* hostedView_; | 30 views::View* hostedView_; |
30 | 31 |
31 // Weak. If non-null the TextInputClient of the currently focused View in the | 32 // Weak. If non-null the TextInputClient of the currently focused View in the |
32 // hierarchy rooted at |hostedView_|. Owned by the focused View. | 33 // hierarchy rooted at |hostedView_|. Owned by the focused View. |
33 ui::TextInputClient* textInputClient_; | 34 ui::TextInputClient* textInputClient_; |
34 | 35 |
35 // A tracking area installed to enable mouseMoved events. | 36 // A tracking area installed to enable mouseMoved events. |
36 ui::ScopedCrTrackingArea cursorTrackingArea_; | 37 ui::ScopedCrTrackingArea cursorTrackingArea_; |
37 | 38 |
38 // Whether the view is reacting to a keyDown event on the view. | 39 // A keyDown event on the view that it is currently processing. |
39 BOOL inKeyDown_; | 40 base::scoped_nsobject<NSEvent> inKeyDown_; |
40 | 41 |
41 // The last tooltip text, used to limit updates. | 42 // The last tooltip text, used to limit updates. |
42 base::string16 lastTooltipText_; | 43 base::string16 lastTooltipText_; |
43 | 44 |
44 // Whether to draw an almost-transparent background with rounded corners so | 45 // Whether to draw an almost-transparent background with rounded corners so |
45 // that OSX correctly blurs the background showing through. | 46 // that OSX correctly blurs the background showing through. |
46 BOOL drawMenuBackgroundForBlur_; | 47 BOOL drawMenuBackgroundForBlur_; |
47 | 48 |
48 // Whether dragging on the view moves the window. | 49 // Whether dragging on the view moves the window. |
49 BOOL mouseDownCanMoveWindow_; | 50 BOOL mouseDownCanMoveWindow_; |
(...skipping 19 matching lines...) Expand all Loading... |
69 | 70 |
70 // Mac's version of views::corewm::TooltipController::UpdateIfRequired(). | 71 // Mac's version of views::corewm::TooltipController::UpdateIfRequired(). |
71 // Updates the tooltip on the ToolTipBaseView if the text needs to change. | 72 // Updates the tooltip on the ToolTipBaseView if the text needs to change. |
72 // |locationInContent| is the position from the top left of the window's | 73 // |locationInContent| is the position from the top left of the window's |
73 // contentRect (also this NSView's frame), as given by a ui::LocatedEvent. | 74 // contentRect (also this NSView's frame), as given by a ui::LocatedEvent. |
74 - (void)updateTooltipIfRequiredAt:(const gfx::Point&)locationInContent; | 75 - (void)updateTooltipIfRequiredAt:(const gfx::Point&)locationInContent; |
75 | 76 |
76 @end | 77 @end |
77 | 78 |
78 #endif // UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_ | 79 #endif // UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_ |
OLD | NEW |