OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import "base/mac/cocoa_protocols.h" | 7 #import "base/mac/cocoa_protocols.h" |
8 #include "base/memory/scoped_nsobject.h" | 8 #include "base/memory/scoped_nsobject.h" |
9 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" | 9 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
11 | 11 |
12 class TabContentsWrapper; | 12 class TabContentsWrapper; |
13 @class BrowserWindowController; | 13 @class BrowserWindowController; |
14 class Browser; | 14 class Browser; |
15 @class GTMUILocalizerAndLayoutTweaker; | 15 @class GTMUILocalizerAndLayoutTweaker; |
16 @class InfoBubbleView; | |
17 | 16 |
18 // The FullscreenExitBubbleController manages the bubble that tells the user | 17 // The FullscreenExitBubbleController manages the bubble that tells the user |
19 // how to escape fullscreen mode. The bubble only appears when a tab requests | 18 // how to escape fullscreen mode. The bubble only appears when a tab requests |
20 // fullscreen mode via webkitRequestFullScreen(). | 19 // fullscreen mode via webkitRequestFullScreen(). |
21 @interface FullscreenExitBubbleController : | 20 @interface FullscreenExitBubbleController : |
22 NSWindowController<NSTextViewDelegate, NSAnimationDelegate> { | 21 NSWindowController<NSTextViewDelegate, NSAnimationDelegate> { |
23 @private | 22 @private |
24 BrowserWindowController* owner_; // weak | 23 BrowserWindowController* owner_; // weak |
25 Browser* browser_; // weak | 24 Browser* browser_; // weak |
26 GURL url_; | 25 GURL url_; |
27 BOOL showButtons_; | 26 BOOL showButtons_; |
28 FullscreenExitBubbleType bubbleType_; | 27 FullscreenExitBubbleType bubbleType_; |
29 | 28 |
30 @protected | 29 @protected |
31 IBOutlet NSTextField* exitLabelPlaceholder_; | 30 IBOutlet NSTextField* exitLabelPlaceholder_; |
32 IBOutlet NSTextField* messageLabel_; | 31 IBOutlet NSTextField* messageLabel_; |
33 IBOutlet NSButton* allowButton_; | 32 IBOutlet NSButton* allowButton_; |
34 IBOutlet NSButton* denyButton_; | 33 IBOutlet NSButton* denyButton_; |
35 IBOutlet InfoBubbleView* bubble_; | |
36 IBOutlet GTMUILocalizerAndLayoutTweaker* tweaker_; | 34 IBOutlet GTMUILocalizerAndLayoutTweaker* tweaker_; |
37 | 35 |
38 // Text fields don't work as well with embedded links as text views, but | 36 // Text fields don't work as well with embedded links as text views, but |
39 // text views cannot conveniently be created in IB. The xib file contains | 37 // text views cannot conveniently be created in IB. The xib file contains |
40 // a text field |exitLabelPlaceholder_| that's replaced by this text view | 38 // a text field |exitLabelPlaceholder_| that's replaced by this text view |
41 // |exitLabel_| in -awakeFromNib. | 39 // |exitLabel_| in -awakeFromNib. |
42 scoped_nsobject<NSTextView> exitLabel_; | 40 scoped_nsobject<NSTextView> exitLabel_; |
43 | 41 |
44 scoped_nsobject<NSTimer> hideTimer_; | 42 scoped_nsobject<NSTimer> hideTimer_; |
45 scoped_nsobject<NSAnimation> hideAnimation_; | 43 scoped_nsobject<NSAnimation> hideAnimation_; |
(...skipping 12 matching lines...) Expand all Loading... |
58 - (void)closeImmediately; | 56 - (void)closeImmediately; |
59 | 57 |
60 // Positions the fullscreen exit bubble in the top-center of the window. | 58 // Positions the fullscreen exit bubble in the top-center of the window. |
61 - (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth; | 59 - (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth; |
62 | 60 |
63 // Updates the bubble contents with |url| and |bubbleType|. | 61 // Updates the bubble contents with |url| and |bubbleType|. |
64 - (void)updateURL:(const GURL&)url | 62 - (void)updateURL:(const GURL&)url |
65 bubbleType:(FullscreenExitBubbleType)bubbleType; | 63 bubbleType:(FullscreenExitBubbleType)bubbleType; |
66 | 64 |
67 @end | 65 @end |
OLD | NEW |