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

Side by Side Diff: chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.h

Issue 10870094: Constrained window sheet controller (test patch) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename Created 8 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_SHEET_CONT ROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_SHEET_CONT ROLLER_H_
7
8 #import <Cocoa/Cocoa.h>
9 #include <vector>
10
11 #include "base/memory/scoped_vector.h"
12 #include "base/memory/scoped_nsobject.h"
13
14 // This class can be used to implement tab modal sheets. Each tab can have
15 // a single sheet and only the active tab's sheet will be visible.
16 @interface ConstrainedWindowSheetController : NSObject <NSAnimationDelegate> {
17 @private
18 scoped_nsobject<NSMutableArray> sheets_;
19 scoped_nsobject<NSWindow> parentWindow_;
20 scoped_nsobject<NSView> activeView_;
21 }
22
23 // Returns a sheet controller for |parentWindow|. If a sheet controller does not
24 // exist yet then one will be created.
25 + (ConstrainedWindowSheetController*)
26 controllerForParentWindow:(NSWindow*)parentWindow;
27
28 // Find a controller that's managing the given sheet. If no such controller
29 // exists then nil is returned.
30 + (ConstrainedWindowSheetController*)controllerForSheet:(NSWindow*)sheet;
31
32 // Shows the given sheet over |parentView|. If |parentView| is not the active
33 // view then the sheet is not shown until the |parentView| becomes active.
34 - (void)showSheet:(NSWindow*)sheet
35 forParentView:(NSView*)parentView;
36
37 // Closes the given sheet. If the parent view of the sheet is currently active
38 // then an asynchronous animation will be run and the sheet will be closed
39 // at the end of the animation.
40 - (void)closeSheet:(NSWindow*)sheet;
41
42 // Make |parentView| the current active view. If |parentView| has an attached
43 // sheet then the sheet is made visible.
44 - (void)parentViewDidBecomeActive:(NSView*)parentView;
45
46 // Gets the number of sheets attached to the controller's window.
47 - (int)sheetCount;
48
49 // Testing only API. End any pending animation for the given sheet.
50 - (void)endAnimationForSheet:(NSWindow*)sheet;
51
52 @end
53
54 #endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_SHEET_C ONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698