| 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 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 kAENormalPriority, // sendPriority | 115 kAENormalPriority, // sendPriority |
| 116 kAEDefaultTimeout, // timeOutInTicks | 116 kAEDefaultTimeout, // timeOutInTicks |
| 117 NULL, // idleProc | 117 NULL, // idleProc |
| 118 NULL); // filterProc | 118 NULL); // filterProc |
| 119 if (status != noErr) { | 119 if (status != noErr) { |
| 120 OSSTATUS_LOG(WARNING, status) | 120 OSSTATUS_LOG(WARNING, status) |
| 121 << "Could not send AE to Finder in OpenItem()"; | 121 << "Could not send AE to Finder in OpenItem()"; |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 void OpenExternal(const GURL& url) { | 125 void OpenExternal(Profile* profile, const GURL& url) { |
| 126 DCHECK([NSThread isMainThread]); | 126 DCHECK([NSThread isMainThread]); |
| 127 NSString* url_string = base::SysUTF8ToNSString(url.spec()); | 127 NSString* url_string = base::SysUTF8ToNSString(url.spec()); |
| 128 NSURL* ns_url = [NSURL URLWithString:url_string]; | 128 NSURL* ns_url = [NSURL URLWithString:url_string]; |
| 129 if (!ns_url || ![[NSWorkspace sharedWorkspace] openURL:ns_url]) | 129 if (!ns_url || ![[NSWorkspace sharedWorkspace] openURL:ns_url]) |
| 130 LOG(WARNING) << "NSWorkspace failed to open URL " << url; | 130 LOG(WARNING) << "NSWorkspace failed to open URL " << url; |
| 131 } | 131 } |
| 132 | 132 |
| 133 gfx::NativeWindow GetTopLevel(gfx::NativeView view) { | 133 gfx::NativeWindow GetTopLevel(gfx::NativeView view) { |
| 134 return [view window]; | 134 return [view window]; |
| 135 } | 135 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 154 [[view window] isVisible]); | 154 [[view window] isVisible]); |
| 155 } | 155 } |
| 156 | 156 |
| 157 bool IsSwipeTrackingFromScrollEventsEnabled() { | 157 bool IsSwipeTrackingFromScrollEventsEnabled() { |
| 158 SEL selector = @selector(isSwipeTrackingFromScrollEventsEnabled); | 158 SEL selector = @selector(isSwipeTrackingFromScrollEventsEnabled); |
| 159 return [NSEvent respondsToSelector:selector] | 159 return [NSEvent respondsToSelector:selector] |
| 160 && [NSEvent performSelector:selector]; | 160 && [NSEvent performSelector:selector]; |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace platform_util | 163 } // namespace platform_util |
| OLD | NEW |