Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / confirm_quit_panel_controller.h
blob2961f257058bc6b78d4ca1f86c2d446f8d30412e
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 #ifndef CHROME_BROWSER_UI_COCOA_CONFIRM_QUIT_PANEL_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_CONFIRM_QUIT_PANEL_CONTROLLER_H_
8 #import <Cocoa/Cocoa.h>
10 @class ConfirmQuitFrameView;
12 namespace ui {
13 class PlatformAcceleratorCocoa;
16 // The ConfirmQuitPanelController manages the black HUD window that tells users
17 // to "Hold Cmd+Q to Quit".
18 @interface ConfirmQuitPanelController : NSWindowController<NSWindowDelegate> {
19 @private
20 // The content view of the window that this controller manages.
21 ConfirmQuitFrameView* contentView_; // Weak, owned by the window.
24 // Returns a singleton instance of the Controller. This will create one if it
25 // does not currently exist.
26 + (ConfirmQuitPanelController*)sharedController;
28 // Checks whether the |event| should trigger the feature.
29 + (BOOL)eventTriggersFeature:(NSEvent*)event;
31 // Runs a modal loop that brings up the panel and handles the logic for if and
32 // when to terminate. Returns NSApplicationTerminateReply for use in
33 // -[NSApplicationDelegate applicationShouldTerminate:].
34 - (NSApplicationTerminateReply)runModalLoopForApplication:(NSApplication*)app;
36 // Shows the window.
37 - (void)showWindow:(id)sender;
39 // If the user did not confirm quit, send this message to give the user
40 // instructions on how to quit.
41 - (void)dismissPanel;
43 // Returns a string representation fit for display of |+quitAccelerator|.
44 + (NSString*)keyCommandString;
46 @end
48 @interface ConfirmQuitPanelController (UnitTesting)
49 + (NSString*)keyCombinationForAccelerator:
50 (const ui::PlatformAcceleratorCocoa&)item;
51 @end
53 #endif // CHROME_BROWSER_UI_COCOA_CONFIRM_QUIT_PANEL_CONTROLLER_H_