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

Side by Side Diff: base/mac/mac_util.mm

Issue 10092017: Mac: Prevent NTP mousewheel events from being suppressed on Lion. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #include "base/mac/mac_util.h" 5 #include "base/mac/mac_util.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #import <IOKit/IOKitLib.h> 8 #import <IOKit/IOKitLib.h>
9 #include <string.h> 9 #include <string.h>
10 #include <sys/utsname.h> 10 #include <sys/utsname.h>
11 11
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/mac/bundle_locations.h" 14 #include "base/mac/bundle_locations.h"
15 #include "base/mac/foundation_util.h" 15 #include "base/mac/foundation_util.h"
16 #include "base/mac/mac_logging.h" 16 #include "base/mac/mac_logging.h"
17 #include "base/mac/scoped_cftyperef.h" 17 #include "base/mac/scoped_cftyperef.h"
18 #include "base/memory/scoped_generic_obj.h" 18 #include "base/memory/scoped_generic_obj.h"
19 #include "base/memory/scoped_nsobject.h" 19 #include "base/memory/scoped_nsobject.h"
20 #include "base/string_number_conversions.h" 20 #include "base/string_number_conversions.h"
21 #include "base/string_piece.h" 21 #include "base/string_piece.h"
22 #include "base/sys_string_conversions.h" 22 #include "base/sys_string_conversions.h"
23 23
24 #if !defined(MAC_OS_X_VERSION_10_7) || \
25 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
26
27 // Declare symbols that are part of the 10.7 SDK.
28
29 @interface NSEvent (LionSDKDeclarations)
30 + (bool)isSwipeTrackingFromScrollEventsEnabled;
31 @end
32
33 #endif // MAC_OS_X_VERSION_10_7
34
24 namespace base { 35 namespace base {
25 namespace mac { 36 namespace mac {
26 37
27 namespace { 38 namespace {
28 39
29 // The current count of outstanding requests for full screen mode from browser 40 // The current count of outstanding requests for full screen mode from browser
30 // windows, plugins, etc. 41 // windows, plugins, etc.
31 int g_full_screen_requests[kNumFullScreenModes] = { 0, 0, 0}; 42 int g_full_screen_requests[kNumFullScreenModes] = { 0, 0, 0};
32 43
33 // Sets the appropriate SystemUIMode based on the current full screen requests. 44 // Sets the appropriate SystemUIMode based on the current full screen requests.
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 StringPiece(begin + number_loc, begin + comma_loc), &major_tmp) || 700 StringPiece(begin + number_loc, begin + comma_loc), &major_tmp) ||
690 !StringToInt( 701 !StringToInt(
691 StringPiece(begin + comma_loc + 1, ident.end()), &minor_tmp)) 702 StringPiece(begin + comma_loc + 1, ident.end()), &minor_tmp))
692 return false; 703 return false;
693 *type = ident.substr(0, number_loc); 704 *type = ident.substr(0, number_loc);
694 *major = major_tmp; 705 *major = major_tmp;
695 *minor = minor_tmp; 706 *minor = minor_tmp;
696 return true; 707 return true;
697 } 708 }
698 709
710 bool IsSwipeTrackingFromScrollEventsEnabled() {
711 return [NSEvent respondsToSelector:@selector(
712 isSwipeTrackingFromScrollEventsEnabled)]
713 && [NSEvent isSwipeTrackingFromScrollEventsEnabled];
714 }
715
699 } // namespace mac 716 } // namespace mac
700 } // namespace base 717 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698