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/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h" | 8 #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 | 10 |
11 @class BrowserWindowController; | 11 class ExclusiveAccessManager; |
12 class Browser; | 12 class Profile; |
13 @class GTMUILocalizerAndLayoutTweaker; | 13 @class GTMUILocalizerAndLayoutTweaker; |
14 @class HyperlinkTextView; | 14 @class HyperlinkTextView; |
15 | 15 |
16 // The ExclusiveAccessBubbleWindowController manages the bubble that informs the | 16 // The ExclusiveAccessBubbleWindowController manages the bubble that informs the |
17 // user of different exclusive access state like fullscreen mode, mouse lock, | 17 // user of different exclusive access state like fullscreen mode, mouse lock, |
18 // etc. Refer to EXCLUSIVE_ACCESS_BUBBLE_TYPE for the different possible | 18 // etc. Refer to EXCLUSIVE_ACCESS_BUBBLE_TYPE for the different possible |
19 // conntents of the bubble. | 19 // conntents of the bubble. |
20 @interface ExclusiveAccessBubbleWindowController | 20 @interface ExclusiveAccessBubbleWindowController |
21 : NSWindowController<NSTextViewDelegate, NSAnimationDelegate> { | 21 : NSWindowController<NSTextViewDelegate, NSAnimationDelegate> { |
22 @private | 22 @private |
23 BrowserWindowController* owner_; // weak | 23 NSWindowController* owner_; // weak |
24 Browser* browser_; // weak | 24 ExclusiveAccessManager* exclusive_access_manager_; // weak |
| 25 Profile* profile_; // weak |
25 GURL url_; | 26 GURL url_; |
26 ExclusiveAccessBubbleType bubbleType_; | 27 ExclusiveAccessBubbleType bubbleType_; |
27 | 28 |
28 @protected | 29 @protected |
29 IBOutlet NSTextField* exitLabelPlaceholder_; | 30 IBOutlet NSTextField* exitLabelPlaceholder_; |
30 IBOutlet NSTextField* messageLabel_; | 31 IBOutlet NSTextField* messageLabel_; |
31 IBOutlet NSButton* allowButton_; | 32 IBOutlet NSButton* allowButton_; |
32 IBOutlet NSButton* denyButton_; | 33 IBOutlet NSButton* denyButton_; |
33 IBOutlet GTMUILocalizerAndLayoutTweaker* tweaker_; | 34 IBOutlet GTMUILocalizerAndLayoutTweaker* tweaker_; |
34 | 35 |
35 // 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 |
36 // 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 |
37 // a text field |exitLabelPlaceholder_| that's replaced by this text view | 38 // a text field |exitLabelPlaceholder_| that's replaced by this text view |
38 // |exitLabel_| in -awakeFromNib. | 39 // |exitLabel_| in -awakeFromNib. |
39 base::scoped_nsobject<HyperlinkTextView> exitLabel_; | 40 base::scoped_nsobject<HyperlinkTextView> exitLabel_; |
40 | 41 |
41 base::scoped_nsobject<NSTimer> hideTimer_; | 42 base::scoped_nsobject<NSTimer> hideTimer_; |
42 base::scoped_nsobject<NSAnimation> hideAnimation_; | 43 base::scoped_nsobject<NSAnimation> hideAnimation_; |
43 }; | 44 }; |
44 | 45 |
45 // Initializes a new InfoBarController. | 46 // Initializes a new InfoBarController. |
46 - (id)initWithOwner:(BrowserWindowController*)owner | 47 - (id)initWithOwner:(NSWindowController*)owner |
47 browser:(Browser*)browser | 48 exclusive_access_manager:(ExclusiveAccessManager*)exclusive_access_manager |
48 url:(const GURL&)url | 49 profile:(Profile*)profile |
49 bubbleType:(ExclusiveAccessBubbleType)bubbleType; | 50 url:(const GURL&)url |
| 51 bubbleType:(ExclusiveAccessBubbleType)bubbleType; |
50 | 52 |
51 - (void)allow:(id)sender; | 53 - (void)allow:(id)sender; |
52 - (void)deny:(id)sender; | 54 - (void)deny:(id)sender; |
53 | 55 |
54 - (void)showWindow; | 56 - (void)showWindow; |
55 - (void)closeImmediately; | 57 - (void)closeImmediately; |
56 | 58 |
57 // Positions the exclusive access bubble in the top-center of the window. | 59 // Positions the exclusive access bubble in the top-center of the window. |
58 - (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth; | 60 - (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth; |
59 | 61 |
60 @end | 62 @end |
OLD | NEW |