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 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | |
|
Scott Hess - ex-Googler
2011/10/10 23:19:50
Can this #import be moved into the .mm file by usi
jeremya
2011/10/11 05:28:48
Done.
| |
| 10 | 11 |
| 11 @class AnimatableView; | 12 @class AnimatableView; |
| 12 class TabContentsWrapper; | 13 class TabContentsWrapper; |
| 13 @class BrowserWindowController; | 14 @class BrowserWindowController; |
| 14 class Browser; | 15 class Browser; |
| 15 | 16 |
| 17 namespace fullscreen_exit_bubble { | |
| 18 const int kBubbleOffsetY = 10; | |
| 19 } // namespace fullscreen_exit_bubble | |
| 20 | |
| 16 // The FullscreenExitBubbleController manages the bubble that tells the user | 21 // The FullscreenExitBubbleController manages the bubble that tells the user |
| 17 // how to escape fullscreen mode. The bubble only appears when a tab requests | 22 // how to escape fullscreen mode. The bubble only appears when a tab requests |
| 18 // fullscreen mode via webkitRequestFullScreen(). | 23 // fullscreen mode via webkitRequestFullScreen(). |
| 19 @interface FullscreenExitBubbleController : | 24 @interface FullscreenExitBubbleController : |
| 20 NSViewController<NSTextViewDelegate, NSAnimationDelegate> { | 25 NSWindowController<NSTextViewDelegate, NSAnimationDelegate> { |
| 21 @private | 26 @private |
| 22 BrowserWindowController* owner_; // weak | 27 BrowserWindowController* owner_; // weak |
| 23 Browser* browser_; // weak | 28 Browser* browser_; // weak |
| 29 GURL url_; | |
| 30 BOOL show_buttons_; | |
| 24 | 31 |
| 25 @protected | 32 @protected |
| 26 IBOutlet NSTextField* exitLabelPlaceholder_; | 33 IBOutlet NSTextField* exitLabelPlaceholder_; |
| 34 IBOutlet NSTextField* siteInfoLabel_; | |
| 35 IBOutlet NSButton* allowButton_; | |
| 36 IBOutlet NSButton* denyButton_; | |
| 37 IBOutlet InfoBubbleView* bubble_; | |
| 38 IBOutlet GTMUILocalizerAndLayoutTweaker* tweaker_; | |
| 27 | 39 |
| 28 // Text fields don't work as well with embedded links as text views, but | 40 // 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 | 41 // text views cannot conveniently be created in IB. The xib file contains |
| 30 // a text field |exitLabelPlaceholder_| that's replaced by this text view | 42 // a text field |exitLabelPlaceholder_| that's replaced by this text view |
| 31 // |exitLabel_| in -awakeFromNib. | 43 // |exitLabel_| in -awakeFromNib. |
| 32 scoped_nsobject<NSTextView> exitLabel_; | 44 scoped_nsobject<NSTextView> exitLabel_; |
| 33 | 45 |
| 34 scoped_nsobject<NSTimer> hideTimer_; | 46 scoped_nsobject<NSTimer> hideTimer_; |
| 35 scoped_nsobject<NSAnimation> hideAnimation_; | 47 scoped_nsobject<NSAnimation> hideAnimation_; |
| 36 }; | 48 }; |
| 37 | 49 |
| 38 - (id)initWithOwner:(BrowserWindowController*)owner browser:(Browser*)browser; | 50 // Initializes a new InfoBarController. |
| 51 - (id)initWithOwner:(BrowserWindowController*)owner browser:(Browser*)browser fo rURL:(const GURL&)url showButtons:(BOOL)show_buttons; | |
| 52 | |
| 53 // Called when someone clicks on the OK or Cancel buttons. Subclasses | |
| 54 // must override if they do not hide the buttons. | |
| 55 - (void)allow:(id)sender; | |
| 56 - (void)deny:(id)sender; | |
| 57 | |
| 58 - (void)showWindow; | |
| 39 | 59 |
| 40 // Positions the fullscreen exit bubble in the top-center of the window. | 60 // Positions the fullscreen exit bubble in the top-center of the window. |
| 41 - (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth; | 61 - (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth; |
| 42 | 62 |
| 43 // Returns a pointer to this controller's view, cast as an AnimatableView. | 63 // Returns a pointer to this controller's view, cast as an AnimatableView. |
| 44 - (AnimatableView*)animatableView; | 64 - (AnimatableView*)animatableView; |
| 45 | 65 |
| 46 @end | 66 @end |
| OLD | NEW |