Chromium Code Reviews| 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 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 | 40 |
| 41 // The last tooltip text, used to limit updates. | 41 // The last tooltip text, used to limit updates. |
| 42 base::string16 lastTooltipText_; | 42 base::string16 lastTooltipText_; |
| 43 | 43 |
| 44 // Whether to draw an almost-transparent background with rounded corners so | 44 // Whether to draw an almost-transparent background with rounded corners so |
| 45 // that OSX correctly blurs the background showing through. | 45 // that OSX correctly blurs the background showing through. |
| 46 BOOL drawMenuBackgroundForBlur_; | 46 BOOL drawMenuBackgroundForBlur_; |
| 47 | 47 |
| 48 // Whether dragging on the view moves the window. | 48 // Whether dragging on the view moves the window. |
| 49 BOOL mouseDownCanMoveWindow_; | 49 BOOL mouseDownCanMoveWindow_; |
| 50 | |
| 51 // The current window mask of the window to which this view is bound. For | |
|
tapted
2016/02/05 04:51:07
nit: This can be more terse. E.g.
// The cached
karandeepb
2016/02/08 07:47:09
Done.
| |
| 52 // windows with rectangular shapes and on Mac OS versions later than 10.9, | |
| 53 // this is not used and is nil. | |
| 54 base::scoped_nsobject<NSBezierPath> windowMask_; | |
| 50 } | 55 } |
| 51 | 56 |
| 52 @property(readonly, nonatomic) views::View* hostedView; | 57 @property(readonly, nonatomic) views::View* hostedView; |
| 53 @property(assign, nonatomic) ui::TextInputClient* textInputClient; | 58 @property(assign, nonatomic) ui::TextInputClient* textInputClient; |
| 54 @property(assign, nonatomic) BOOL drawMenuBackgroundForBlur; | 59 @property(assign, nonatomic) BOOL drawMenuBackgroundForBlur; |
| 55 | 60 |
| 56 // Extends an atomic, readonly property on NSView to make it assignable. | 61 // Extends an atomic, readonly property on NSView to make it assignable. |
| 57 // This usually returns YES if the view is transparent. We want to control it | 62 // This usually returns YES if the view is transparent. We want to control it |
| 58 // so that BridgedNativeWidget can dynamically enable dragging of the window. | 63 // so that BridgedNativeWidget can dynamically enable dragging of the window. |
| 59 @property(assign) BOOL mouseDownCanMoveWindow; | 64 @property(assign) BOOL mouseDownCanMoveWindow; |
| 60 | 65 |
| 61 // Initialize the NSView -> views::View bridge. |viewToHost| must be non-NULL. | 66 // Initialize the NSView -> views::View bridge. |viewToHost| must be non-NULL. |
| 62 - (id)initWithView:(views::View*)viewToHost; | 67 - (id)initWithView:(views::View*)viewToHost; |
| 63 | 68 |
| 64 // Clear the hosted view. For example, if it is about to be destroyed. | 69 // Clear the hosted view. For example, if it is about to be destroyed. |
| 65 - (void)clearView; | 70 - (void)clearView; |
| 66 | 71 |
| 67 // Process a mouse event captured while the widget had global mouse capture. | 72 // Process a mouse event captured while the widget had global mouse capture. |
| 68 - (void)processCapturedMouseEvent:(NSEvent*)theEvent; | 73 - (void)processCapturedMouseEvent:(NSEvent*)theEvent; |
| 69 | 74 |
| 70 // Mac's version of views::corewm::TooltipController::UpdateIfRequired(). | 75 // Mac's version of views::corewm::TooltipController::UpdateIfRequired(). |
| 71 // Updates the tooltip on the ToolTipBaseView if the text needs to change. | 76 // 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 | 77 // |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. | 78 // contentRect (also this NSView's frame), as given by a ui::LocatedEvent. |
| 74 - (void)updateTooltipIfRequiredAt:(const gfx::Point&)locationInContent; | 79 - (void)updateTooltipIfRequiredAt:(const gfx::Point&)locationInContent; |
| 75 | 80 |
| 76 @end | 81 @end |
| 77 | 82 |
| 78 #endif // UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_ | 83 #endif // UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_ |
| OLD | NEW |