OLD | NEW |
---|---|
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 CHROME_BROWSER_UI_COCOA_PRESENTATION_MODE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PRESENTATION_MODE_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_PRESENTATION_MODE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PRESENTATION_MODE_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 // The content view for the window. This is nil when not in presentation | 33 // The content view for the window. This is nil when not in presentation |
34 // mode. | 34 // mode. |
35 NSView* contentView_; // weak | 35 NSView* contentView_; // weak |
36 | 36 |
37 // YES while this controller is in the process of entering presentation mode. | 37 // YES while this controller is in the process of entering presentation mode. |
38 BOOL enteringPresentationMode_; | 38 BOOL enteringPresentationMode_; |
39 | 39 |
40 // Whether or not we are in presentation mode. | 40 // Whether or not we are in presentation mode. |
41 BOOL inPresentationMode_; | 41 BOOL inPresentationMode_; |
42 | 42 |
43 // YES if the floating dropdown bar should remain visible. When YES, disables | |
44 // the mouse tracking and all timers. | |
45 BOOL alwaysShowDropdown_; | |
Robert Sesek
2014/07/14 14:13:32
Have you looked at -[BrowserWindowController lockB
leng
2014/07/14 18:17:24
I did, early on during my investigation. I though
Robert Sesek
2014/07/14 20:22:31
I'd prefer to not add a flag just for the sake of
leng
2014/07/14 21:28:32
I don't think so, but don't feel that strongly abo
| |
46 | |
43 // The tracking area associated with the floating dropdown bar. This tracking | 47 // The tracking area associated with the floating dropdown bar. This tracking |
44 // area is attached to |contentView_|, because when the dropdown is completely | 48 // area is attached to |contentView_|, because when the dropdown is completely |
45 // hidden, we still need to keep a 1px tall tracking area visible. Attaching | 49 // hidden, we still need to keep a 1px tall tracking area visible. Attaching |
46 // to the content view allows us to do this. |trackingArea_| can be nil if | 50 // to the content view allows us to do this. |trackingArea_| can be nil if |
47 // not in presentation mode or during animations. | 51 // not in presentation mode or during animations. |
48 base::scoped_nsobject<NSTrackingArea> trackingArea_; | 52 base::scoped_nsobject<NSTrackingArea> trackingArea_; |
49 | 53 |
50 // Pointer to the currently running animation. Is nil if no animation is | 54 // Pointer to the currently running animation. Is nil if no animation is |
51 // running. | 55 // running. |
52 base::scoped_nsobject<DropdownAnimation> currentAnimation_; | 56 base::scoped_nsobject<DropdownAnimation> currentAnimation_; |
(...skipping 14 matching lines...) Expand all Loading... | |
67 // hidden, and |kFullScreenModeHideDock| while the overlay is shown. If the | 71 // hidden, and |kFullScreenModeHideDock| while the overlay is shown. If the |
68 // window is not on the primary screen, this should always be | 72 // window is not on the primary screen, this should always be |
69 // |kFullScreenModeNormal|. This value can get out of sync with the correct | 73 // |kFullScreenModeNormal|. This value can get out of sync with the correct |
70 // state if we miss a notification (which can happen when a window is closed). | 74 // state if we miss a notification (which can happen when a window is closed). |
71 // Used to track the current state and make sure we properly restore the menu | 75 // Used to track the current state and make sure we properly restore the menu |
72 // bar when this controller is destroyed. | 76 // bar when this controller is destroyed. |
73 base::mac::FullScreenMode systemFullscreenMode_; | 77 base::mac::FullScreenMode systemFullscreenMode_; |
74 } | 78 } |
75 | 79 |
76 @property(readonly, nonatomic) BOOL inPresentationMode; | 80 @property(readonly, nonatomic) BOOL inPresentationMode; |
81 @property(readwrite, nonatomic) BOOL alwaysShowDropdown; | |
77 | 82 |
78 // Designated initializer. | 83 // Designated initializer. |
79 - (id)initWithBrowserController:(BrowserWindowController*)controller; | 84 - (id)initWithBrowserController:(BrowserWindowController*)controller; |
80 | 85 |
81 // Informs the controller that the browser has entered or exited presentation | 86 // Informs the controller that the browser has entered or exited presentation |
82 // mode. |-enterPresentationModeForContentView:showDropdown:| should be called | 87 // mode. |-enterPresentationModeForContentView:showDropdown:| should be called |
83 // after the window is setup, just before it is shown. |-exitPresentationMode| | 88 // after the window is setup, just before it is shown. |-exitPresentationMode| |
84 // should be called before any views are moved back to the non-fullscreen | 89 // should be called before any views are moved back to the non-fullscreen |
85 // window. If |-enterPresentationModeForContentView:showDropdown:| is called, | 90 // window. If |-enterPresentationModeForContentView:showDropdown:| is called, |
86 // it must be balanced with a call to |-exitPresentationMode| before the | 91 // it must be balanced with a call to |-exitPresentationMode| before the |
(...skipping 27 matching lines...) Expand all Loading... | |
114 // effects, such as modifying the system fullscreen mode (menu bar shown state). | 119 // effects, such as modifying the system fullscreen mode (menu bar shown state). |
115 - (void)changeFloatingBarShownFraction:(CGFloat)fraction; | 120 - (void)changeFloatingBarShownFraction:(CGFloat)fraction; |
116 | 121 |
117 @end | 122 @end |
118 | 123 |
119 // Notification posted when we're about to enter or leave fullscreen. | 124 // Notification posted when we're about to enter or leave fullscreen. |
120 extern NSString* const kWillEnterFullscreenNotification; | 125 extern NSString* const kWillEnterFullscreenNotification; |
121 extern NSString* const kWillLeaveFullscreenNotification; | 126 extern NSString* const kWillLeaveFullscreenNotification; |
122 | 127 |
123 #endif // CHROME_BROWSER_UI_COCOA_PRESENTATION_MODE_CONTROLLER_H_ | 128 #endif // CHROME_BROWSER_UI_COCOA_PRESENTATION_MODE_CONTROLLER_H_ |
OLD | NEW |