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 #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 namespace confirm_quit { |
| 16 |
| 17 enum ConfirmQuitMetric { |
| 18 // The user quit without having the feature enabled. |
| 19 kNoConfirm = 0, |
| 20 // The user held Cmd+Q for the entire duration. |
| 21 kHoldDuration, |
| 22 // The user hit Cmd+Q twice for the accelerated path. |
| 23 kDoubleTap, |
| 24 // The user tapped Cmd+Q once and then held it. |
| 25 kTapHold, |
| 26 |
| 27 kSampleCount |
| 28 }; |
| 29 |
| 30 // Records the histogram value for the above metric. |
| 31 void RecordHistogram(ConfirmQuitMetric sample); |
| 32 |
| 33 } // namespace confirm_quit |
| 34 |
15 // The ConfirmQuitPanelController manages the black HUD window that tells users | 35 // The ConfirmQuitPanelController manages the black HUD window that tells users |
16 // to "Hold Cmd+Q to Quit". | 36 // to "Hold Cmd+Q to Quit". |
17 @interface ConfirmQuitPanelController : NSWindowController<NSWindowDelegate> { | 37 @interface ConfirmQuitPanelController : NSWindowController<NSWindowDelegate> { |
18 @private | 38 @private |
19 // The content view of the window that this controller manages. | 39 // The content view of the window that this controller manages. |
20 ConfirmQuitFrameView* contentView_; // Weak, owned by the window. | 40 ConfirmQuitFrameView* contentView_; // Weak, owned by the window. |
21 } | 41 } |
22 | 42 |
23 // Returns a singleton instance of the Controller. This will create one if it | 43 // Returns a singleton instance of the Controller. This will create one if it |
24 // does not currently exist. | 44 // does not currently exist. |
(...skipping 20 matching lines...) Expand all Loading... |
45 // Returns a string representation fit for display of |+quitAccelerator|. | 65 // Returns a string representation fit for display of |+quitAccelerator|. |
46 + (NSString*)keyCommandString; | 66 + (NSString*)keyCommandString; |
47 | 67 |
48 @end | 68 @end |
49 | 69 |
50 @interface ConfirmQuitPanelController (UnitTesting) | 70 @interface ConfirmQuitPanelController (UnitTesting) |
51 + (NSString*)keyCombinationForAccelerator:(const ui::AcceleratorCocoa&)item; | 71 + (NSString*)keyCombinationForAccelerator:(const ui::AcceleratorCocoa&)item; |
52 @end | 72 @end |
53 | 73 |
54 #endif // CHROME_BROWSER_UI_COCOA_CONFIRM_QUIT_PANEL_CONTROLLER_H_ | 74 #endif // CHROME_BROWSER_UI_COCOA_CONFIRM_QUIT_PANEL_CONTROLLER_H_ |
OLD | NEW |