| OLD | NEW |
| 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 "chrome/browser/platform_util.h" | 5 #include "chrome/browser/platform_util.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <CoreServices/CoreServices.h> | 9 #include <CoreServices/CoreServices.h> |
| 10 | 10 |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/mac/mac_logging.h" | 13 #include "base/mac/mac_logging.h" |
| 14 #include "base/mac/scoped_aedesc.h" | 14 #include "base/mac/scoped_aedesc.h" |
| 15 #include "base/strings/sys_string_conversions.h" | 15 #include "base/strings/sys_string_conversions.h" |
| 16 #include "grit/generated_resources.h" | |
| 17 #include "ui/base/l10n/l10n_util.h" | |
| 18 #include "ui/base/l10n/l10n_util_mac.h" | |
| 19 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 20 | 17 |
| 21 namespace platform_util { | 18 namespace platform_util { |
| 22 | 19 |
| 23 void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) { | 20 void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) { |
| 24 DCHECK([NSThread isMainThread]); | 21 DCHECK([NSThread isMainThread]); |
| 25 NSString* path_string = base::SysUTF8ToNSString(full_path.value()); | 22 NSString* path_string = base::SysUTF8ToNSString(full_path.value()); |
| 26 if (!path_string || ![[NSWorkspace sharedWorkspace] selectFile:path_string | 23 if (!path_string || ![[NSWorkspace sharedWorkspace] selectFile:path_string |
| 27 inFileViewerRootedAtPath:nil]) | 24 inFileViewerRootedAtPath:nil]) |
| 28 LOG(WARNING) << "NSWorkspace failed to select file " << full_path.value(); | 25 LOG(WARNING) << "NSWorkspace failed to select file " << full_path.value(); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 [[view window] isVisible]); | 151 [[view window] isVisible]); |
| 155 } | 152 } |
| 156 | 153 |
| 157 bool IsSwipeTrackingFromScrollEventsEnabled() { | 154 bool IsSwipeTrackingFromScrollEventsEnabled() { |
| 158 SEL selector = @selector(isSwipeTrackingFromScrollEventsEnabled); | 155 SEL selector = @selector(isSwipeTrackingFromScrollEventsEnabled); |
| 159 return [NSEvent respondsToSelector:selector] | 156 return [NSEvent respondsToSelector:selector] |
| 160 && [NSEvent performSelector:selector]; | 157 && [NSEvent performSelector:selector]; |
| 161 } | 158 } |
| 162 | 159 |
| 163 } // namespace platform_util | 160 } // namespace platform_util |
| OLD | NEW |