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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/memory/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.h" | 8 #include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 | 10 |
11 @class BrowserWindowController; | 11 @class BrowserWindowController; |
12 class Browser; | 12 class Browser; |
13 @class GTMUILocalizerAndLayoutTweaker; | 13 @class GTMUILocalizerAndLayoutTweaker; |
14 | 14 |
15 // The FullscreenExitBubbleController manages the bubble that tells the user | 15 // The FullscreenExitBubbleController manages the bubble that tells the user |
16 // how to escape fullscreen mode. The bubble only appears when a tab requests | 16 // how to escape fullscreen mode. The bubble only appears when a tab requests |
17 // fullscreen mode via webkitRequestFullScreen(). | 17 // fullscreen mode via webkitRequestFullScreen(). |
18 @interface FullscreenExitBubbleController : | 18 @interface FullscreenExitBubbleController : |
19 NSWindowController<NSTextViewDelegate, NSAnimationDelegate> { | 19 NSWindowController<NSTextViewDelegate, NSAnimationDelegate> { |
20 @private | 20 @private |
21 BrowserWindowController* owner_; // weak | 21 BrowserWindowController* owner_; // weak |
22 Browser* browser_; // weak | 22 Browser* browser_; // weak |
23 GURL url_; | 23 GURL url_; |
24 FullscreenExitBubbleType bubbleType_; | 24 FullscreenExitBubbleType bubbleType_; |
25 | 25 |
26 @protected | 26 @protected |
27 IBOutlet NSTextField* exitLabelPlaceholder_; | 27 IBOutlet NSTextField* exitLabelPlaceholder_; |
28 IBOutlet NSTextField* messageLabel_; | 28 IBOutlet NSTextField* messageLabel_; |
29 IBOutlet NSButton* allowButton_; | 29 IBOutlet NSButton* allowButton_; |
30 IBOutlet NSButton* denyButton_; | 30 IBOutlet NSButton* denyButton_; |
31 IBOutlet GTMUILocalizerAndLayoutTweaker* tweaker_; | 31 IBOutlet GTMUILocalizerAndLayoutTweaker* tweaker_; |
32 | 32 |
33 // Text fields don't work as well with embedded links as text views, but | 33 // Text fields don't work as well with embedded links as text views, but |
34 // text views cannot conveniently be created in IB. The xib file contains | 34 // text views cannot conveniently be created in IB. The xib file contains |
35 // a text field |exitLabelPlaceholder_| that's replaced by this text view | 35 // a text field |exitLabelPlaceholder_| that's replaced by this text view |
36 // |exitLabel_| in -awakeFromNib. | 36 // |exitLabel_| in -awakeFromNib. |
37 scoped_nsobject<NSTextView> exitLabel_; | 37 base::scoped_nsobject<NSTextView> exitLabel_; |
38 | 38 |
39 scoped_nsobject<NSTimer> hideTimer_; | 39 base::scoped_nsobject<NSTimer> hideTimer_; |
40 scoped_nsobject<NSAnimation> hideAnimation_; | 40 base::scoped_nsobject<NSAnimation> hideAnimation_; |
41 }; | 41 }; |
42 | 42 |
43 // Initializes a new InfoBarController. | 43 // Initializes a new InfoBarController. |
44 - (id)initWithOwner:(BrowserWindowController*)owner | 44 - (id)initWithOwner:(BrowserWindowController*)owner |
45 browser:(Browser*)browser | 45 browser:(Browser*)browser |
46 url:(const GURL&)url | 46 url:(const GURL&)url |
47 bubbleType:(FullscreenExitBubbleType)bubbleType; | 47 bubbleType:(FullscreenExitBubbleType)bubbleType; |
48 | 48 |
49 - (void)allow:(id)sender; | 49 - (void)allow:(id)sender; |
50 - (void)deny:(id)sender; | 50 - (void)deny:(id)sender; |
51 | 51 |
52 - (void)showWindow; | 52 - (void)showWindow; |
53 - (void)closeImmediately; | 53 - (void)closeImmediately; |
54 | 54 |
55 // Positions the fullscreen exit bubble in the top-center of the window. | 55 // Positions the fullscreen exit bubble in the top-center of the window. |
56 - (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth; | 56 - (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth; |
57 | 57 |
58 @end | 58 @end |
OLD | NEW |