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 "content/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 #include <QuartzCore/QuartzCore.h> | 8 #include <QuartzCore/QuartzCore.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // These are not documented, so use only after checking -respondsToSelector:. | 97 // These are not documented, so use only after checking -respondsToSelector:. |
98 @interface NSApplication (UndocumentedSpeechMethods) | 98 @interface NSApplication (UndocumentedSpeechMethods) |
99 - (void)speakString:(NSString*)string; | 99 - (void)speakString:(NSString*)string; |
100 - (void)stopSpeaking:(id)sender; | 100 - (void)stopSpeaking:(id)sender; |
101 - (BOOL)isSpeaking; | 101 - (BOOL)isSpeaking; |
102 @end | 102 @end |
103 | 103 |
104 // Declare things that are part of the 10.7 SDK. | 104 // Declare things that are part of the 10.7 SDK. |
105 #if !defined(MAC_OS_X_VERSION_10_7) || \ | 105 #if !defined(MAC_OS_X_VERSION_10_7) || \ |
106 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | 106 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 |
107 @interface NSView (NSOpenGLSurfaceResolutionLionAPI) | |
108 - (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag; | |
109 @end | |
110 | 107 |
111 static NSString* const NSWindowDidChangeBackingPropertiesNotification = | 108 static NSString* const NSWindowDidChangeBackingPropertiesNotification = |
112 @"NSWindowDidChangeBackingPropertiesNotification"; | 109 @"NSWindowDidChangeBackingPropertiesNotification"; |
113 | 110 |
114 #endif // 10.7 | 111 #endif // 10.7 |
115 | 112 |
116 // Declare things that are part of the 10.9 SDK. | |
117 #if !defined(MAC_OS_X_VERSION_10_9) || \ | |
118 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9 | |
119 enum { | |
120 NSWindowOcclusionStateVisible = 1UL << 1, | |
121 }; | |
122 typedef NSUInteger NSWindowOcclusionState; | |
123 | |
124 @interface NSWindow (MavericksAPI) | |
125 - (NSWindowOcclusionState)occlusionState; | |
126 @end | |
127 | |
128 #endif // 10.9 | |
129 | |
130 // This method will return YES for OS X versions 10.7.3 and later, and NO | 113 // This method will return YES for OS X versions 10.7.3 and later, and NO |
131 // otherwise. | 114 // otherwise. |
132 // Used to prevent a crash when building with the 10.7 SDK and accessing the | 115 // Used to prevent a crash when building with the 10.7 SDK and accessing the |
133 // notification below. See: http://crbug.com/260595. | 116 // notification below. See: http://crbug.com/260595. |
134 static BOOL SupportsBackingPropertiesChangedNotification() { | 117 static BOOL SupportsBackingPropertiesChangedNotification() { |
135 // windowDidChangeBackingProperties: method has been added to the | 118 // windowDidChangeBackingProperties: method has been added to the |
136 // NSWindowDelegate protocol in 10.7.3, at the same time as the | 119 // NSWindowDelegate protocol in 10.7.3, at the same time as the |
137 // NSWindowDidChangeBackingPropertiesNotification notification was added. | 120 // NSWindowDidChangeBackingPropertiesNotification notification was added. |
138 // If the protocol contains this method description, the notification should | 121 // If the protocol contains this method description, the notification should |
139 // be supported as well. | 122 // be supported as well. |
(...skipping 4231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4371 | 4354 |
4372 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 4355 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
4373 // regions that are not draggable. (See ControlRegionView in | 4356 // regions that are not draggable. (See ControlRegionView in |
4374 // native_app_window_cocoa.mm). This requires the render host view to be | 4357 // native_app_window_cocoa.mm). This requires the render host view to be |
4375 // draggable by default. | 4358 // draggable by default. |
4376 - (BOOL)mouseDownCanMoveWindow { | 4359 - (BOOL)mouseDownCanMoveWindow { |
4377 return YES; | 4360 return YES; |
4378 } | 4361 } |
4379 | 4362 |
4380 @end | 4363 @end |
OLD | NEW |