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

Side by Side Diff: chrome/browser/cocoa/browser_window_controller.h

Issue 3136003: [Mac] Refactor the fullscreen code to move logic from BWC into FullscreenCont... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/cocoa/browser_window_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_COCOA_BROWSER_WINDOW_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_
6 #define CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ 6 #define CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_
7 #pragma once 7 #pragma once
8 8
9 // A class acting as the Objective-C controller for the Browser 9 // A class acting as the Objective-C controller for the Browser
10 // object. Handles interactions between Cocoa and the cross-platform 10 // object. Handles interactions between Cocoa and the cross-platform
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 // The raw accumulated zoom value and the actual zoom increments made for an 92 // The raw accumulated zoom value and the actual zoom increments made for an
93 // an in-progress pinch gesture. 93 // an in-progress pinch gesture.
94 CGFloat totalMagnifyGestureAmount_; 94 CGFloat totalMagnifyGestureAmount_;
95 NSInteger currentZoomStepDelta_; 95 NSInteger currentZoomStepDelta_;
96 96
97 // The view which shows the incognito badge (NULL if not an incognito window). 97 // The view which shows the incognito badge (NULL if not an incognito window).
98 // Needed to access the view to move it to/from the fullscreen window. 98 // Needed to access the view to move it to/from the fullscreen window.
99 scoped_nsobject<IncognitoImageView> incognitoBadge_; 99 scoped_nsobject<IncognitoImageView> incognitoBadge_;
100 100
101 // Lazily created view which draws the background for the floating set of bars
102 // in fullscreen mode (for window types having a floating bar; it remains nil
103 // for those which don't).
104 scoped_nsobject<NSView> floatingBarBackingView_;
105
106 // Tracks whether the floating bar is above or below the bookmark bar, in 101 // Tracks whether the floating bar is above or below the bookmark bar, in
107 // terms of z-order. 102 // terms of z-order.
108 BOOL floatingBarAboveBookmarkBar_; 103 BOOL floatingBarAboveBookmarkBar_;
109 104
110 // The proportion of the floating bar which is shown (in fullscreen mode).
111 CGFloat floatingBarShownFraction_;
112
113 // Various UI elements/events may want to ensure that the floating bar is 105 // Various UI elements/events may want to ensure that the floating bar is
114 // visible (in fullscreen mode), e.g., because of where the mouse is or where 106 // visible (in fullscreen mode), e.g., because of where the mouse is or where
115 // keyboard focus is. Whenever an object requires bar visibility, it has 107 // keyboard focus is. Whenever an object requires bar visibility, it has
116 // itself added to |barVisibilityLocks_|. When it no longer requires bar 108 // itself added to |barVisibilityLocks_|. When it no longer requires bar
117 // visibility, it has itself removed. 109 // visibility, it has itself removed.
118 scoped_nsobject<NSMutableSet> barVisibilityLocks_; 110 scoped_nsobject<NSMutableSet> barVisibilityLocks_;
119 111
120 // Bar visibility locks and releases only result (when appropriate) in changes 112 // Bar visibility locks and releases only result (when appropriate) in changes
121 // in visible state when the following is |YES|. 113 // in visible state when the following is |YES|.
122 BOOL barVisibilityUpdatesEnabled_; 114 BOOL barVisibilityUpdatesEnabled_;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 - (void)setFullscreen:(BOOL)fullscreen; 299 - (void)setFullscreen:(BOOL)fullscreen;
308 300
309 // Returns fullscreen state. 301 // Returns fullscreen state.
310 - (BOOL)isFullscreen; 302 - (BOOL)isFullscreen;
311 303
312 // Resizes the fullscreen window to fit the screen it's currently on. Called by 304 // Resizes the fullscreen window to fit the screen it's currently on. Called by
313 // the FullscreenController when there is a change in monitor placement or 305 // the FullscreenController when there is a change in monitor placement or
314 // resolution. 306 // resolution.
315 - (void)resizeFullscreenWindow; 307 - (void)resizeFullscreenWindow;
316 308
317 // Gets or sets the fraction of the floating bar (fullscreen overlay) that is
318 // shown. 0 is completely hidden, 1 is fully shown.
319 - (CGFloat)floatingBarShownFraction;
320 - (void)setFloatingBarShownFraction:(CGFloat)fraction;
321
322 // Query/lock/release the requirement that the tab strip/toolbar/attached 309 // Query/lock/release the requirement that the tab strip/toolbar/attached
323 // bookmark bar bar cluster is visible (e.g., when one of its elements has 310 // bookmark bar bar cluster is visible (e.g., when one of its elements has
324 // focus). This is required for the floating bar in fullscreen mode, but should 311 // focus). This is required for the floating bar in fullscreen mode, but should
325 // also be called when not in fullscreen mode; see the comments for 312 // also be called when not in fullscreen mode; see the comments for
326 // |barVisibilityLocks_| for more details. Double locks/releases by the same 313 // |barVisibilityLocks_| for more details. Double locks/releases by the same
327 // owner are ignored. If |animate:| is YES, then an animation may be performed, 314 // owner are ignored. If |animate:| is YES, then an animation may be performed,
328 // possibly after a small delay if |delay:| is YES. If |animate:| is NO, 315 // possibly after a small delay if |delay:| is YES. If |animate:| is NO,
329 // |delay:| will be ignored. In the case of multiple calls, later calls have 316 // |delay:| will be ignored. In the case of multiple calls, later calls have
330 // precedence with the rule that |animate:NO| has precedence over |animate:YES|, 317 // precedence with the rule that |animate:NO| has precedence over |animate:YES|,
331 // and |delay:NO| has precedence over |delay:YES|. 318 // and |delay:NO| has precedence over |delay:YES|.
332 - (BOOL)isBarVisibilityLockedForOwner:(id)owner; 319 - (BOOL)isBarVisibilityLockedForOwner:(id)owner;
333 - (void)lockBarVisibilityForOwner:(id)owner 320 - (void)lockBarVisibilityForOwner:(id)owner
334 withAnimation:(BOOL)animate 321 withAnimation:(BOOL)animate
335 delay:(BOOL)delay; 322 delay:(BOOL)delay;
336 - (void)releaseBarVisibilityForOwner:(id)owner 323 - (void)releaseBarVisibilityForOwner:(id)owner
337 withAnimation:(BOOL)animate 324 withAnimation:(BOOL)animate
338 delay:(BOOL)delay; 325 delay:(BOOL)delay;
339 326
340 // Returns YES if any of the views in the floating bar currently has focus. 327 // Returns YES if any of the views in the floating bar currently has focus.
341 - (BOOL)floatingBarHasFocus; 328 - (BOOL)floatingBarHasFocus;
342 329
343 // Opens the tabpose window. 330 // Opens the tabpose window.
344 - (void)openTabpose; 331 - (void)openTabpose;
345 332
333 - (void)floatingBarShownFractionChanged;
334
346 @end // @interface BrowserWindowController(Fullscreen) 335 @end // @interface BrowserWindowController(Fullscreen)
347 336
348 337
349 // Methods which are either only for testing, or only public for testing. 338 // Methods which are either only for testing, or only public for testing.
350 @interface BrowserWindowController(TestingAPI) 339 @interface BrowserWindowController(TestingAPI)
351 340
352 // Put the incognito badge on the browser and adjust the tab strip 341 // Put the incognito badge on the browser and adjust the tab strip
353 // accordingly. 342 // accordingly.
354 - (void)installIncognitoBadge; 343 - (void)installIncognitoBadge;
355 344
356 // Allows us to initWithBrowser withOUT taking ownership of the browser. 345 // Allows us to initWithBrowser withOUT taking ownership of the browser.
357 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt; 346 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt;
358 347
359 // Adjusts the window height by the given amount. If the window spans from the 348 // Adjusts the window height by the given amount. If the window spans from the
360 // top of the current workspace to the bottom of the current workspace, the 349 // top of the current workspace to the bottom of the current workspace, the
361 // height is not adjusted. If growing the window by the requested amount would 350 // height is not adjusted. If growing the window by the requested amount would
362 // size the window to be taller than the current workspace, the window height is 351 // size the window to be taller than the current workspace, the window height is
363 // capped to be equal to the height of the current workspace. If the window is 352 // capped to be equal to the height of the current workspace. If the window is
364 // partially offscreen, its height is not adjusted at all. This function 353 // partially offscreen, its height is not adjusted at all. This function
365 // prefers to grow the window down, but will grow up if needed. Calls to this 354 // prefers to grow the window down, but will grow up if needed. Calls to this
366 // function should be followed by a call to |layoutSubviews|. 355 // function should be followed by a call to |layoutSubviews|.
367 - (void)adjustWindowHeightBy:(CGFloat)deltaH; 356 - (void)adjustWindowHeightBy:(CGFloat)deltaH;
368 357
369 // Return an autoreleased NSWindow suitable for fullscreen use.
370 - (NSWindow*)createFullscreenWindow;
371
372 // Resets any saved state about window growth (due to showing the bookmark bar 358 // Resets any saved state about window growth (due to showing the bookmark bar
373 // or the download shelf), so that future shrinking will occur from the bottom. 359 // or the download shelf), so that future shrinking will occur from the bottom.
374 - (void)resetWindowGrowthState; 360 - (void)resetWindowGrowthState;
375 361
376 @end // @interface BrowserWindowController(TestingAPI) 362 @end // @interface BrowserWindowController(TestingAPI)
377 363
378 364
379 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ 365 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698