Chromium Code Reviews| 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 "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 | 10 |
| 11 @class AnimatableView; | |
| 12 class TabContentsWrapper; | 11 class TabContentsWrapper; |
| 13 @class BrowserWindowController; | 12 @class BrowserWindowController; |
| 14 class Browser; | 13 class Browser; |
| 14 @class GTMUILocalizerAndLayoutTweaker; | |
| 15 | |
| 16 namespace fullscreen_exit_bubble { | |
| 17 const int kBubbleOffsetY = 10; | |
| 18 } // namespace fullscreen_exit_bubble | |
|
Scott Hess - ex-Googler
2011/10/13 20:30:27
I don't really get why you have this out here, rat
koz (OOO until 15th September)
2011/10/14 00:35:16
Done.
| |
| 15 | 19 |
| 16 // The FullscreenExitBubbleController manages the bubble that tells the user | 20 // The FullscreenExitBubbleController manages the bubble that tells the user |
| 17 // how to escape fullscreen mode. The bubble only appears when a tab requests | 21 // how to escape fullscreen mode. The bubble only appears when a tab requests |
| 18 // fullscreen mode via webkitRequestFullScreen(). | 22 // fullscreen mode via webkitRequestFullScreen(). |
| 19 @interface FullscreenExitBubbleController : | 23 @interface FullscreenExitBubbleController : |
| 20 NSViewController<NSTextViewDelegate, NSAnimationDelegate> { | 24 NSWindowController<NSTextViewDelegate, NSAnimationDelegate> { |
| 21 @private | 25 @private |
| 22 BrowserWindowController* owner_; // weak | 26 BrowserWindowController* owner_; // weak |
| 23 Browser* browser_; // weak | 27 Browser* browser_; // weak |
| 28 GURL url_; | |
| 29 BOOL showButtons_; | |
| 24 | 30 |
| 25 @protected | 31 @protected |
| 26 IBOutlet NSTextField* exitLabelPlaceholder_; | 32 IBOutlet NSTextField* exitLabelPlaceholder_; |
| 33 IBOutlet NSTextField* messageLabel_; | |
| 34 IBOutlet NSButton* allowButton_; | |
| 35 IBOutlet NSButton* denyButton_; | |
| 36 IBOutlet InfoBubbleView* bubble_; | |
| 37 IBOutlet GTMUILocalizerAndLayoutTweaker* tweaker_; | |
| 27 | 38 |
| 28 // Text fields don't work as well with embedded links as text views, but | 39 // Text fields don't work as well with embedded links as text views, but |
| 29 // text views cannot conveniently be created in IB. The xib file contains | 40 // text views cannot conveniently be created in IB. The xib file contains |
| 30 // a text field |exitLabelPlaceholder_| that's replaced by this text view | 41 // a text field |exitLabelPlaceholder_| that's replaced by this text view |
| 31 // |exitLabel_| in -awakeFromNib. | 42 // |exitLabel_| in -awakeFromNib. |
| 32 scoped_nsobject<NSTextView> exitLabel_; | 43 scoped_nsobject<NSTextView> exitLabel_; |
| 33 | 44 |
| 34 scoped_nsobject<NSTimer> hideTimer_; | 45 scoped_nsobject<NSTimer> hideTimer_; |
| 35 scoped_nsobject<NSAnimation> hideAnimation_; | 46 scoped_nsobject<NSAnimation> hideAnimation_; |
| 36 }; | 47 }; |
| 37 | 48 |
| 38 - (id)initWithOwner:(BrowserWindowController*)owner browser:(Browser*)browser; | 49 // Initializes a new InfoBarController. |
| 50 - (id)initWithOwner:(BrowserWindowController*)owner | |
| 51 browser:(Browser*)browser | |
| 52 forURL:(const GURL&)url | |
| 53 askPermission:(BOOL)askPermission; | |
| 54 | |
| 55 // Called when someone clicks on the OK or Cancel buttons. Subclasses | |
| 56 // must override if they do not hide the buttons. | |
|
Nico
2011/10/13 05:24:10
There are no subclasses, are there? Are there ok o
koz (OOO until 15th September)
2011/10/13 06:09:43
Ah, copy/paste fail. Fixed.
| |
| 57 - (void)allow:(id)sender; | |
| 58 - (void)deny:(id)sender; | |
| 59 | |
| 60 - (void)showWindow; | |
| 39 | 61 |
| 40 // Positions the fullscreen exit bubble in the top-center of the window. | 62 // Positions the fullscreen exit bubble in the top-center of the window. |
| 41 - (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth; | 63 - (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth; |
| 42 | 64 |
| 43 // Returns a pointer to this controller's view, cast as an AnimatableView. | |
| 44 - (AnimatableView*)animatableView; | |
| 45 | |
| 46 @end | 65 @end |
| OLD | NEW |