[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / fullscreen_exit_bubble_controller.h
blobf2ce3546a866670625e3f8523e17b80a0b11d365
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
3 // found in the LICENSE file.
5 #import <Cocoa/Cocoa.h>
7 #include "base/mac/scoped_nsobject.h"
8 #include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.h"
9 #include "url/gurl.h"
11 @class BrowserWindowController;
12 class Browser;
13 @class GTMUILocalizerAndLayoutTweaker;
15 // The FullscreenExitBubbleController manages the bubble that tells the user
16 // how to escape fullscreen mode. The bubble only appears when a tab requests
17 // fullscreen mode via webkitRequestFullScreen().
18 @interface FullscreenExitBubbleController :
19 NSWindowController<NSTextViewDelegate, NSAnimationDelegate> {
20 @private
21 BrowserWindowController* owner_; // weak
22 Browser* browser_; // weak
23 GURL url_;
24 FullscreenExitBubbleType bubbleType_;
26 @protected
27 IBOutlet NSTextField* exitLabelPlaceholder_;
28 IBOutlet NSTextField* messageLabel_;
29 IBOutlet NSButton* allowButton_;
30 IBOutlet NSButton* denyButton_;
31 IBOutlet GTMUILocalizerAndLayoutTweaker* tweaker_;
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
35 // a text field |exitLabelPlaceholder_| that's replaced by this text view
36 // |exitLabel_| in -awakeFromNib.
37 base::scoped_nsobject<NSTextView> exitLabel_;
39 base::scoped_nsobject<NSTimer> hideTimer_;
40 base::scoped_nsobject<NSAnimation> hideAnimation_;
43 // Initializes a new InfoBarController.
44 - (id)initWithOwner:(BrowserWindowController*)owner
45 browser:(Browser*)browser
46 url:(const GURL&)url
47 bubbleType:(FullscreenExitBubbleType)bubbleType;
49 - (void)allow:(id)sender;
50 - (void)deny:(id)sender;
52 - (void)showWindow;
53 - (void)closeImmediately;
55 // Positions the fullscreen exit bubble in the top-center of the window.
56 - (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth;
58 @end