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

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

Issue 2688413007: Add display::GetDisplayNearestView (Closed)
Patch Set: add missing files Created 3 years, 10 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 "chrome/browser/platform_util.h" 5 #include "chrome/browser/platform_util.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } // namespace internal 73 } // namespace internal
74 74
75 void OpenExternal(Profile* profile, const GURL& url) { 75 void OpenExternal(Profile* profile, const GURL& url) {
76 DCHECK([NSThread isMainThread]); 76 DCHECK([NSThread isMainThread]);
77 NSString* url_string = base::SysUTF8ToNSString(url.spec()); 77 NSString* url_string = base::SysUTF8ToNSString(url.spec());
78 NSURL* ns_url = [NSURL URLWithString:url_string]; 78 NSURL* ns_url = [NSURL URLWithString:url_string];
79 if (!ns_url || ![[NSWorkspace sharedWorkspace] openURL:ns_url]) 79 if (!ns_url || ![[NSWorkspace sharedWorkspace] openURL:ns_url])
80 LOG(WARNING) << "NSWorkspace failed to open URL " << url; 80 LOG(WARNING) << "NSWorkspace failed to open URL " << url;
81 } 81 }
82 82
83 gfx::NativeWindow GetTopLevel(gfx::NativeView view) {
84 return [view window];
85 }
86
87 gfx::NativeView GetViewForWindow(gfx::NativeWindow window) { 83 gfx::NativeView GetViewForWindow(gfx::NativeWindow window) {
88 DCHECK(window); 84 DCHECK(window);
89 DCHECK([window contentView]); 85 DCHECK([window contentView]);
90 return [window contentView]; 86 return [window contentView];
91 } 87 }
92 88
93 gfx::NativeView GetParent(gfx::NativeView view) { 89 gfx::NativeView GetParent(gfx::NativeView view) {
94 return nil; 90 return nil;
95 } 91 }
96 92
(...skipping 13 matching lines...) Expand all
110 [[view window] isVisible]); 106 [[view window] isVisible]);
111 } 107 }
112 108
113 bool IsSwipeTrackingFromScrollEventsEnabled() { 109 bool IsSwipeTrackingFromScrollEventsEnabled() {
114 SEL selector = @selector(isSwipeTrackingFromScrollEventsEnabled); 110 SEL selector = @selector(isSwipeTrackingFromScrollEventsEnabled);
115 return [NSEvent respondsToSelector:selector] 111 return [NSEvent respondsToSelector:selector]
116 && [NSEvent performSelector:selector]; 112 && [NSEvent performSelector:selector];
117 } 113 }
118 114
119 } // namespace platform_util 115 } // namespace platform_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698