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

Side by Side Diff: chrome/browser/platform_util_mac.mm

Issue 107033003: Stop using GetDefaultProfile() in Chrome OS implementation of platform_util::OpenExternal() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove is_valid check Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/platform_util_linux.cc ('k') | chrome/browser/platform_util_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/platform_util_linux.cc ('k') | chrome/browser/platform_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698