Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: chrome/browser/ui/cocoa/confirm_quit_panel_controller.h

Issue 6625025: [Mac] Confirm-to-Quit: Wait for a KeyUp event if the user held Cmd+Q on the second tap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CHROME_BROWSER_UI_COCOA_CONFIRM_QUIT_PANEL_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_CONFIRM_QUIT_PANEL_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_CONFIRM_QUIT_PANEL_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_COCOA_CONFIRM_QUIT_PANEL_CONTROLLER_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #import "base/mac/cocoa_protocols.h" 10 #import "base/mac/cocoa_protocols.h"
11 #include "ui/base/models/accelerator_cocoa.h" 11 #include "ui/base/models/accelerator_cocoa.h"
12 12
13 @class ConfirmQuitFrameView; 13 @class ConfirmQuitFrameView;
14 14
15 // The ConfirmQuitPanelController manages the black HUD window that tells users 15 // The ConfirmQuitPanelController manages the black HUD window that tells users
16 // to "Hold Cmd+Q to Quit". 16 // to "Hold Cmd+Q to Quit".
17 @interface ConfirmQuitPanelController : NSWindowController<NSWindowDelegate> { 17 @interface ConfirmQuitPanelController : NSWindowController<NSWindowDelegate> {
18 @private 18 @private
19 // The content view of the window that this controller manages. 19 // The content view of the window that this controller manages.
20 ConfirmQuitFrameView* contentView_; // Weak, owned by the window. 20 ConfirmQuitFrameView* contentView_; // Weak, owned by the window.
21 } 21 }
22 22
23 // Returns a singleton instance of the Controller. This will create one if it 23 // Returns a singleton instance of the Controller. This will create one if it
24 // does not currently exist. 24 // does not currently exist.
25 + (ConfirmQuitPanelController*)sharedController; 25 + (ConfirmQuitPanelController*)sharedController;
26 26
27 // Runs a modal loop that brings up the panel and handles the logic for if and
28 // when to terminate. Returns NSApplicationTerminateReply for use in
29 // -[NSApplicationDelegate applicationShouldTerminate:].
30 - (NSApplicationTerminateReply)runModalLoopForApplication:(NSApplication*)app;
31
27 // Shows the window. 32 // Shows the window.
28 - (void)showWindow:(id)sender; 33 - (void)showWindow:(id)sender;
29 34
30 // If the user did not confirm quit, send this message to give the user 35 // If the user did not confirm quit, send this message to give the user
31 // instructions on how to quit. 36 // instructions on how to quit.
32 - (void)dismissPanel; 37 - (void)dismissPanel;
33 38
34 // Returns the Accelerator for the Quit menu item. 39 // Returns the Accelerator for the Quit menu item.
35 + (ui::AcceleratorCocoa)quitAccelerator; 40 + (ui::AcceleratorCocoa)quitAccelerator;
36 41
37 @end 42 @end
38 43
39 @interface ConfirmQuitPanelController (UnitTesting) 44 @interface ConfirmQuitPanelController (UnitTesting)
40 - (NSString*)keyCombinationForAccelerator:(const ui::AcceleratorCocoa&)item; 45 - (NSString*)keyCombinationForAccelerator:(const ui::AcceleratorCocoa&)item;
41 @end 46 @end
42 47
43 #endif // CHROME_BROWSER_UI_COCOA_CONFIRM_QUIT_PANEL_CONTROLLER_H_ 48 #endif // CHROME_BROWSER_UI_COCOA_CONFIRM_QUIT_PANEL_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698