| Index: ui/base/cocoa/appkit_utils.mm
|
| diff --git a/ui/base/cocoa/appkit_utils.mm b/ui/base/cocoa/appkit_utils.mm
|
| index ce672699f5d16a602aa511987a549b75a9967ddd..1b0a61b2060314e77da4814f97610fc8f9590ded 100644
|
| --- a/ui/base/cocoa/appkit_utils.mm
|
| +++ b/ui/base/cocoa/appkit_utils.mm
|
| @@ -9,12 +9,6 @@
|
|
|
| namespace {
|
|
|
| -// Gets an NSImage given an image id.
|
| -NSImage* GetImage(int image_id) {
|
| - return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(image_id)
|
| - .ToNSImage();
|
| -}
|
| -
|
| // Double-click in window title bar actions.
|
| enum class DoubleClickAction {
|
| NONE,
|
| @@ -22,6 +16,20 @@ enum class DoubleClickAction {
|
| MAXIMIZE,
|
| };
|
|
|
| +// Values of com.apple.trackpad.forceClick corresponding to "Look up & data
|
| +// detectors" in System Preferences -> Trackpad -> Point & Click.
|
| +enum class ForceTouchAction {
|
| + NONE = 0, // Unchecked or set to "Tap with three fingers".
|
| + QUICK_LOOK = 1, // Set to "Force Click with one finger".
|
| +};
|
| +
|
| +// Gets an NSImage given an image id.
|
| +NSImage* GetImage(int image_id) {
|
| + return ui::ResourceBundle::GetSharedInstance()
|
| + .GetNativeImageNamed(image_id)
|
| + .ToNSImage();
|
| +}
|
| +
|
| // The action to take when the user double-clicks in the window title bar.
|
| DoubleClickAction WindowTitleBarDoubleClickAction() {
|
| // El Capitan introduced a Dock preference to configure the window title bar
|
| @@ -95,4 +103,10 @@ void WindowTitlebarReceivedDoubleClick(NSWindow* window, id sender) {
|
| }
|
| }
|
|
|
| +bool ForceClickInvokesQuickLook() {
|
| + return [[NSUserDefaults standardUserDefaults]
|
| + integerForKey:@"com.apple.trackpad.forceClick"] ==
|
| + static_cast<NSInteger>(ForceTouchAction::QUICK_LOOK);
|
| +}
|
| +
|
| } // namespace ui
|
|
|