summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-10 22:47:14 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-10 22:47:14 +0000
commit59e82f0e04c380286ba38d77d0f244c777c9c74d (patch)
tree1da89fa2c9ea943f09c280f80192abba077f8e3e
parent8e87c36bef2e6f3e33e06143380d9bf09e47a418 (diff)
downloadchromium_src-59e82f0e04c380286ba38d77d0f244c777c9c74d.zip
chromium_src-59e82f0e04c380286ba38d77d0f244c777c9c74d.tar.gz
chromium_src-59e82f0e04c380286ba38d77d0f244c777c9c74d.tar.bz2
mac: Remove more 10.5-only code
BUG=137676 TBR=jamiewalch,tony Review URL: https://chromiumcodereview.appspot.com/10825302 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151142 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/mac/mac_util.h9
-rw-r--r--base/mac/mac_util.mm14
-rw-r--r--base/mac/mac_util_unittest.mm6
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller.mm17
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm2
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller_private.h12
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller_private.mm22
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller_unittest.mm2
-rw-r--r--chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm4
-rw-r--r--chrome/browser/ui/cocoa/presentation_mode_controller.mm4
-rw-r--r--content/common/sandbox_mac.mm2
-rw-r--r--content/renderer/renderer_main.cc27
-rw-r--r--printing/pdf_metafile_cg_mac.cc2
-rw-r--r--remoting/host/plugin/daemon_controller_mac.cc3
-rw-r--r--remoting/host/video_frame_capturer_unittest.cc18
-rw-r--r--ui/base/cocoa/underlay_opengl_hosting_window.mm70
-rw-r--r--webkit/plugins/npapi/plugin_host.cc5
17 files changed, 86 insertions, 133 deletions
diff --git a/base/mac/mac_util.h b/base/mac/mac_util.h
index ba13ff9..1b75167 100644
--- a/base/mac/mac_util.h
+++ b/base/mac/mac_util.h
@@ -128,8 +128,6 @@ BASE_EXPORT bool WasLaunchedAsHiddenLoginItem();
// Snow Leopard is Mac OS X 10.6, Darwin 10.
BASE_EXPORT bool IsOSSnowLeopard();
-BASE_EXPORT bool IsOSSnowLeopardOrEarlier();
-BASE_EXPORT bool IsOSSnowLeopardOrLater();
// Lion is Mac OS X 10.7, Darwin 11.
BASE_EXPORT bool IsOSLion();
@@ -151,17 +149,10 @@ BASE_EXPORT
// constant-value inline functions. The MAC_OS_X_VERSION_MIN_REQUIRED macro
// contains the value of the deployment target.
-#if defined(MAC_OS_X_VERSION_10_6) && \
- MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
-#define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_6
-inline bool IsOSSnowLeopardOrLater() { return true; }
-#endif
-
#if defined(MAC_OS_X_VERSION_10_7) && \
MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
#define BASE_MAC_MAC_UTIL_H_INLINED_GE_10_7
inline bool IsOSSnowLeopard() { return false; }
-inline bool IsOSSnowLeopardOrEarlier() { return false; }
inline bool IsOSLionOrLater() { return true; }
#endif
diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm
index f6aeebe..a0aa72c 100644
--- a/base/mac/mac_util.mm
+++ b/base/mac/mac_util.mm
@@ -475,7 +475,7 @@ bool WasLaunchedAsHiddenLoginItem() {
if (!item.get()) {
// Lion can launch items for the resume feature. So log an error only for
// Snow Leopard or earlier.
- if (IsOSSnowLeopardOrEarlier())
+ if (IsOSSnowLeopard())
DLOG(ERROR) <<
"Process launched at Login but can't access Login Item List.";
@@ -573,18 +573,6 @@ bool IsOSSnowLeopard() {
}
#endif
-#if !defined(BASE_MAC_MAC_UTIL_H_INLINED_GE_10_7)
-bool IsOSSnowLeopardOrEarlier() {
- return MacOSXMinorVersion() <= SNOW_LEOPARD_MINOR_VERSION;
-}
-#endif
-
-#if !defined(BASE_MAC_MAC_UTIL_H_INLINED_GE_10_6)
-bool IsOSSnowLeopardOrLater() {
- return MacOSXMinorVersion() >= SNOW_LEOPARD_MINOR_VERSION;
-}
-#endif
-
#if !defined(BASE_MAC_MAC_UTIL_H_INLINED_GT_10_7)
bool IsOSLion() {
return MacOSXMinorVersion() == LION_MINOR_VERSION;
diff --git a/base/mac/mac_util_unittest.mm b/base/mac/mac_util_unittest.mm
index 94ec5bd..f239036 100644
--- a/base/mac/mac_util_unittest.mm
+++ b/base/mac/mac_util_unittest.mm
@@ -153,8 +153,6 @@ TEST_F(MacUtilTest, IsOSEllipsis) {
if (major == 10) {
if (minor == 6) {
EXPECT_TRUE(IsOSSnowLeopard());
- EXPECT_TRUE(IsOSSnowLeopardOrEarlier());
- EXPECT_TRUE(IsOSSnowLeopardOrLater());
EXPECT_FALSE(IsOSLion());
EXPECT_TRUE(IsOSLionOrEarlier());
EXPECT_FALSE(IsOSLionOrLater());
@@ -164,8 +162,6 @@ TEST_F(MacUtilTest, IsOSEllipsis) {
IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement());
} else if (minor == 7) {
EXPECT_FALSE(IsOSSnowLeopard());
- EXPECT_FALSE(IsOSSnowLeopardOrEarlier());
- EXPECT_TRUE(IsOSSnowLeopardOrLater());
EXPECT_TRUE(IsOSLion());
EXPECT_TRUE(IsOSLionOrEarlier());
EXPECT_TRUE(IsOSLionOrLater());
@@ -175,8 +171,6 @@ TEST_F(MacUtilTest, IsOSEllipsis) {
IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement());
} else if (minor == 8) {
EXPECT_FALSE(IsOSSnowLeopard());
- EXPECT_FALSE(IsOSSnowLeopardOrEarlier());
- EXPECT_TRUE(IsOSSnowLeopardOrLater());
EXPECT_FALSE(IsOSLion());
EXPECT_FALSE(IsOSLionOrEarlier());
EXPECT_TRUE(IsOSLionOrLater());
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index fe1d890..79afd27 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -244,9 +244,9 @@ enum {
// Set the window to not have rounded corners, which prevents the resize
// control from being inset slightly and looking ugly. Only bother to do
- // this on Snow Leopard and earlier; on Lion and later all windows have
- // rounded bottom corners, and this won't work anyway.
- if (base::mac::IsOSSnowLeopardOrEarlier() &&
+ // this on Snow Leopard; on Lion and later all windows have rounded bottom
+ // corners, and this won't work anyway.
+ if (base::mac::IsOSSnowLeopard() &&
[window respondsToSelector:@selector(setBottomCornerRounded:)])
[window setBottomCornerRounded:NO];
@@ -1045,7 +1045,7 @@ enum {
IDS_ENTER_FULLSCREEN_MAC);
[static_cast<NSMenuItem*>(item) setTitle:menuTitle];
- if (base::mac::IsOSSnowLeopardOrEarlier())
+ if (base::mac::IsOSSnowLeopard())
[static_cast<NSMenuItem*>(item) setHidden:YES];
}
break;
@@ -1981,9 +1981,9 @@ willAnimateFromState:(bookmarks::VisualState)oldState
[static_cast<FramedBrowserWindow*>([self window]) toggleSystemFullScreen];
} else {
if (fullscreen)
- [self enterFullscreenForSnowLeopardOrEarlier];
+ [self enterFullscreenForSnowLeopard];
else
- [self exitFullscreenForSnowLeopardOrEarlier];
+ [self exitFullscreenForSnowLeopard];
}
}
@@ -2022,9 +2022,8 @@ willAnimateFromState:(bookmarks::VisualState)oldState
fullscreenUrl_ = url;
fullscreenBubbleType_ = bubbleType;
- // Presentation mode on Leopard and Snow Leopard maps directly to fullscreen
- // mode.
- if (base::mac::IsOSSnowLeopardOrEarlier()) {
+ // Presentation mode on Snow Leopard maps directly to fullscreen mode.
+ if (base::mac::IsOSSnowLeopard()) {
[self setFullscreen:presentationMode url:url bubbleType:bubbleType];
return;
}
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm b/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm
index 7024ec0..cd541aa 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm
@@ -41,7 +41,7 @@ void CreateProfileCallback(const base::Closure& quit_closure,
// correctly.
IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest,
ProfileAvatarFullscreenButton) {
- if (base::mac::IsOSSnowLeopardOrEarlier())
+ if (base::mac::IsOSSnowLeopard())
return;
// Initialize the locals.
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.h b/chrome/browser/ui/cocoa/browser_window_controller_private.h
index de79ef5..41ce451 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.h
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.h
@@ -110,13 +110,13 @@
- (BOOL)shouldShowPresentationModeToggle;
// Moves views between windows in preparation for fullscreen mode on Snow
-// Leopard or earlier. (Lion and later reuses the original window for
+// Leopard. (Lion and later reuses the original window for
// fullscreen mode, so there is no need to move views around.) This method does
// not position views; callers must also call |-layoutSubviews|. This method
// must not be called on Lion or later.
-- (void)moveViewsForFullscreenForSnowLeopardOrEarlier:(BOOL)fullscreen
- regularWindow:(NSWindow*)regularWindow
- fullscreenWindow:(NSWindow*)fullscreenWindow;
+- (void)moveViewsForFullscreenForSnowLeopard:(BOOL)fullscreen
+ regularWindow:(NSWindow*)regularWindow
+ fullscreenWindow:(NSWindow*)fullscreenWindow;
// Sets presentation mode, creating the PresentationModeController if needed and
// forcing a relayout. If |forceDropdown| is YES, this method will always
@@ -129,8 +129,8 @@
// Called on Snow Leopard or earlier to enter or exit fullscreen. These methods
// are internal implementations of |-setFullscreen:|. These methods must not be
// called on Lion or later.
-- (void)enterFullscreenForSnowLeopardOrEarlier;
-- (void)exitFullscreenForSnowLeopardOrEarlier;
+- (void)enterFullscreenForSnowLeopard;
+- (void)exitFullscreenForSnowLeopard;
// Register or deregister for content view resize notifications. These
// notifications are used while transitioning to fullscreen mode in Lion or
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
index c0c44b8..1f31c47 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -514,11 +514,11 @@ willPositionSheet:(NSWindow*)sheet
return base::mac::IsOSLionOrLater() && [self isFullscreen];
}
-- (void)moveViewsForFullscreenForSnowLeopardOrEarlier:(BOOL)fullscreen
+- (void)moveViewsForFullscreenForSnowLeopard:(BOOL)fullscreen
regularWindow:(NSWindow*)regularWindow
fullscreenWindow:(NSWindow*)fullscreenWindow {
- // This method is only for Snow Leopard and earlier.
- DCHECK(base::mac::IsOSSnowLeopardOrEarlier());
+ // This method is only for Snow Leopard.
+ DCHECK(base::mac::IsOSSnowLeopard());
NSWindow* sourceWindow = fullscreen ? regularWindow : fullscreenWindow;
NSWindow* destWindow = fullscreen ? fullscreenWindow : regularWindow;
@@ -634,8 +634,8 @@ willPositionSheet:(NSWindow*)sheet
[self layoutSubviews];
}
-- (void)enterFullscreenForSnowLeopardOrEarlier {
- DCHECK(base::mac::IsOSSnowLeopardOrEarlier());
+- (void)enterFullscreenForSnowLeopard {
+ DCHECK(base::mac::IsOSSnowLeopard());
// Fade to black.
const CGDisplayReservationInterval kFadeDurationSeconds = 0.6;
@@ -654,9 +654,9 @@ willPositionSheet:(NSWindow*)sheet
savedRegularWindow_ = [[self window] retain];
savedRegularWindowFrame_ = [savedRegularWindow_ frame];
- [self moveViewsForFullscreenForSnowLeopardOrEarlier:YES
- regularWindow:[self window]
- fullscreenWindow:fullscreenWindow_.get()];
+ [self moveViewsForFullscreenForSnowLeopard:YES
+ regularWindow:[self window]
+ fullscreenWindow:fullscreenWindow_.get()];
[self adjustUIForPresentationMode:YES];
[self setPresentationModeInternal:YES forceDropdown:NO];
[self layoutSubviews];
@@ -671,8 +671,8 @@ willPositionSheet:(NSWindow*)sheet
}
}
-- (void)exitFullscreenForSnowLeopardOrEarlier {
- DCHECK(base::mac::IsOSSnowLeopardOrEarlier());
+- (void)exitFullscreenForSnowLeopard {
+ DCHECK(base::mac::IsOSSnowLeopard());
// Fade to black.
const CGDisplayReservationInterval kFadeDurationSeconds = 0.6;
@@ -687,7 +687,7 @@ willPositionSheet:(NSWindow*)sheet
[self windowWillExitFullScreen:nil];
- [self moveViewsForFullscreenForSnowLeopardOrEarlier:NO
+ [self moveViewsForFullscreenForSnowLeopard:NO
regularWindow:savedRegularWindow_
fullscreenWindow:fullscreenWindow_.get()];
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm b/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm
index 4025c9b..9c0569e 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm
@@ -707,7 +707,7 @@ TEST_F(BrowserWindowFullScreenControllerTest, TestActivate) {
[controller_ activate];
// No fullscreen window on 10.7+.
- if (base::mac::IsOSSnowLeopardOrEarlier())
+ if (base::mac::IsOSSnowLeopard())
EXPECT_TRUE(IsFrontWindow([controller_ createFullscreenWindow]));
// We have to cleanup after ourselves by unfullscreening.
diff --git a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
index 828d4ad..ce638bc 100644
--- a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
@@ -129,7 +129,7 @@ ShellWindowCocoa::ShellWindowCocoa(Profile* profile,
[window setContentMaxSize:NSMakeSize(max_width, max_height)];
}
- if (base::mac::IsOSSnowLeopardOrEarlier() &&
+ if (base::mac::IsOSSnowLeopard() &&
[window respondsToSelector:@selector(setBottomCornerRounded:)])
[window setBottomCornerRounded:NO];
@@ -200,7 +200,7 @@ void ShellWindowCocoa::SetFullscreen(bool fullscreen) {
return;
}
- DCHECK(base::mac::IsOSSnowLeopardOrEarlier());
+ DCHECK(base::mac::IsOSSnowLeopard());
// Fade to black.
const CGDisplayReservationInterval kFadeDurationSeconds = 0.6;
diff --git a/chrome/browser/ui/cocoa/presentation_mode_controller.mm b/chrome/browser/ui/cocoa/presentation_mode_controller.mm
index 30b8974..8b11839 100644
--- a/chrome/browser/ui/cocoa/presentation_mode_controller.mm
+++ b/chrome/browser/ui/cocoa/presentation_mode_controller.mm
@@ -200,7 +200,7 @@ const CGFloat kFloatingBarVerticalOffset = 22;
// Disable these notifications on Lion as they cause crashes.
// TODO(rohitrao): Figure out what happens if a fullscreen window changes
// monitors on Lion.
- if (base::mac::IsOSSnowLeopardOrEarlier()) {
+ if (base::mac::IsOSSnowLeopard()) {
[nc addObserver:self
selector:@selector(windowDidChangeScreen:)
name:NSWindowDidChangeScreenNotification
@@ -421,7 +421,7 @@ const CGFloat kFloatingBarVerticalOffset = 22;
}
- (BOOL)shouldToggleMenuBar {
- return base::mac::IsOSSnowLeopardOrEarlier() &&
+ return base::mac::IsOSSnowLeopard() &&
[self isWindowOnPrimaryScreen] &&
[[browserController_ window] isMainWindow];
}
diff --git a/content/common/sandbox_mac.mm b/content/common/sandbox_mac.mm
index 105340e..5c136f5 100644
--- a/content/common/sandbox_mac.mm
+++ b/content/common/sandbox_mac.mm
@@ -546,7 +546,7 @@ bool Sandbox::EnableSandbox(int sandbox_type,
// dlopen() fails without file-read-metadata access if the executable image
// contains LC_RPATH load commands. The components build uses those.
// See http://crbug.com/127465
- if (base::mac::IsOSSnowLeopardOrEarlier()) {
+ if (base::mac::IsOSSnowLeopard()) {
FilePath bundle_executable = base::mac::NSStringToFilePath(
[base::mac::MainBundle() executablePath]);
NSString* sandbox_command = AllowMetadataForPath(
diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc
index 5618ada..a84a3cb 100644
--- a/content/renderer/renderer_main.cc
+++ b/content/renderer/renderer_main.cc
@@ -56,16 +56,23 @@ void InstallFrameworkHacks() {
// See http://crbug.com/31225
// TODO: Don't do this on newer OS X revisions that have a fix for
// http://openradar.appspot.com/radar?id=1156410
- if (base::mac::IsOSSnowLeopardOrLater()) {
- // Chinese Handwriting was introduced in 10.6. Since doing this override
- // regresses page cycler memory usage on 10.5, don't do the unnecessary
- // override there.
- mach_error_t err = mach_override_ptr(
- (void*)&TISCreateInputSourceList,
- (void*)&ChromeTISCreateInputSourceList,
- NULL);
- CHECK_EQ(err_none, err);
- }
+ // To check if this is broken:
+ // 1. Enable Multi language input (simplified chinese)
+ // 2. Ensure "Show/Hide Trackpad Handwriting" shortcut works.
+ // (ctrl+shift+space).
+ // 3. Now open a new tab in Google Chrome or start Google Chrome
+ // 4. Try ctrl+shift+space shortcut again. Shortcut will not work, IME will
+ // either not appear or (worse) not disappear on ctrl-shift-space.
+ // (Run `ps aux | grep Chinese` (10.6/10.7) or `ps aux | grep Trackpad`
+ // and then kill that pid to make it go away.)
+
+ // Chinese Handwriting was introduced in 10.6 and is confirmed broken on
+ // 10.6, 10.7, and 10.8.
+ mach_error_t err = mach_override_ptr(
+ (void*)&TISCreateInputSourceList,
+ (void*)&ChromeTISCreateInputSourceList,
+ NULL);
+ CHECK_EQ(err_none, err);
}
#endif // OS_MACOSX
diff --git a/printing/pdf_metafile_cg_mac.cc b/printing/pdf_metafile_cg_mac.cc
index 6b4e7f3..d484ec9 100644
--- a/printing/pdf_metafile_cg_mac.cc
+++ b/printing/pdf_metafile_cg_mac.cc
@@ -48,7 +48,7 @@ PdfMetafileCg::PdfMetafileCg()
: page_is_open_(false),
thread_pdf_docs_owned_(false) {
if (!thread_pdf_docs.Pointer()->Get() &&
- base::mac::IsOSSnowLeopardOrEarlier()) {
+ base::mac::IsOSSnowLeopard()) {
thread_pdf_docs_owned_ = true;
thread_pdf_docs.Pointer()->Set(
CFSetCreateMutable(kCFAllocatorDefault, 0, &kCFTypeSetCallBacks));
diff --git a/remoting/host/plugin/daemon_controller_mac.cc b/remoting/host/plugin/daemon_controller_mac.cc
index f7d11c8..66505c8 100644
--- a/remoting/host/plugin/daemon_controller_mac.cc
+++ b/remoting/host/plugin/daemon_controller_mac.cc
@@ -108,9 +108,6 @@ void DaemonControllerMac::DeregisterForPreferencePaneNotifications() {
}
DaemonController::State DaemonControllerMac::GetState() {
- if (!base::mac::IsOSSnowLeopardOrLater()) {
- return DaemonController::STATE_NOT_IMPLEMENTED;
- }
pid_t job_pid = base::mac::PIDForJob(kServiceName);
if (job_pid < 0) {
return DaemonController::STATE_NOT_INSTALLED;
diff --git a/remoting/host/video_frame_capturer_unittest.cc b/remoting/host/video_frame_capturer_unittest.cc
index 306c6ba..4ad0a1b 100644
--- a/remoting/host/video_frame_capturer_unittest.cc
+++ b/remoting/host/video_frame_capturer_unittest.cc
@@ -18,16 +18,6 @@ namespace remoting {
namespace {
-bool IsOsSupported() {
-#if defined(OS_MACOSX)
- // Verify that the OS is at least Snow Leopard (10.6).
- // Chromoting doesn't support 10.5 or earlier.
- return base::mac::IsOSSnowLeopardOrLater();
-#else
- return true;
-#endif
-}
-
void IgnoreCursorShapeChanged(scoped_ptr<protocol::CursorShapeInfo> info) {
}
@@ -53,19 +43,11 @@ class VideoFrameCapturerTest : public testing::Test {
};
TEST_F(VideoFrameCapturerTest, StartCapturer) {
- if (!IsOsSupported()) {
- return;
- }
-
capturer_->Start(base::Bind(&IgnoreCursorShapeChanged));
capturer_->Stop();
}
TEST_F(VideoFrameCapturerTest, Capture) {
- if (!IsOsSupported()) {
- return;
- }
-
// Assume that Start() treats the screen as invalid initially.
EXPECT_CALL(capture_completed_callback_,
CaptureCompletedPtr(DirtyRegionIsNonEmptyRect()));
diff --git a/ui/base/cocoa/underlay_opengl_hosting_window.mm b/ui/base/cocoa/underlay_opengl_hosting_window.mm
index 4ef7092..48833e8 100644
--- a/ui/base/cocoa/underlay_opengl_hosting_window.mm
+++ b/ui/base/cocoa/underlay_opengl_hosting_window.mm
@@ -104,43 +104,39 @@ void RootDidAddSubview(id self, SEL _cmd, NSView* subview) {
styleMask:windowStyle
backing:bufferingType
defer:deferCreation])) {
- if (base::mac::IsOSSnowLeopardOrLater()) {
- // Hole punching is used when IOSurfaces are used to transport, which is
- // only on > 10.5. Therefore, on > 10.5, the window must always be
- // non-opaque whether or not it's titled if we want hole punching to work.
- [self setOpaque:NO];
-
- if (windowStyle & NSTitledWindowMask) {
- // Only fiddle with shadows if the window is a proper window with a
- // title bar and all. (The invisible opaque area technique only works on
- // > 10.5, but that is guaranteed by this point.)
- [self _setContentHasShadow:NO];
-
- NSView* rootView = [[self contentView] superview];
- const NSRect rootBounds = [rootView bounds];
-
- // On 10.7/8, the bottom corners of the window are rounded by magic at a
- // deeper level than the NSThemeFrame, so it is OK to have the opaques
- // go all the way to the bottom.
- const CGFloat kTopEdgeInset = 16;
- const CGFloat kAlphaValueJustOpaqueEnough = 0.002;
-
- scoped_nsobject<NSView> leftOpaque([[OpaqueView alloc] initWithFrame:
- NSMakeRect(NSMinX(rootBounds), NSMinY(rootBounds),
- 1, NSHeight(rootBounds) - kTopEdgeInset)]);
- [leftOpaque setAutoresizingMask:NSViewMaxXMargin |
- NSViewHeightSizable];
- [leftOpaque setAlphaValue:kAlphaValueJustOpaqueEnough];
- [rootView addSubview:leftOpaque];
-
- scoped_nsobject<NSView> rightOpaque([[OpaqueView alloc] initWithFrame:
- NSMakeRect(NSMaxX(rootBounds) - 1, NSMinY(rootBounds),
- 1, NSHeight(rootBounds) - kTopEdgeInset)]);
- [rightOpaque setAutoresizingMask:NSViewMinXMargin |
- NSViewHeightSizable];
- [rightOpaque setAlphaValue:kAlphaValueJustOpaqueEnough];
- [rootView addSubview:rightOpaque];
- }
+ // OpenGL-accelerated content works by punching holes in windows. Therefore
+ // all windows hosting OpenGL content must not be opaque.
+ [self setOpaque:NO];
+
+ if (windowStyle & NSTitledWindowMask) {
+ // Only fiddle with shadows if the window is a proper window with a
+ // title bar and all.
+ [self _setContentHasShadow:NO];
+
+ NSView* rootView = [[self contentView] superview];
+ const NSRect rootBounds = [rootView bounds];
+
+ // On 10.7/8, the bottom corners of the window are rounded by magic at a
+ // deeper level than the NSThemeFrame, so it is OK to have the opaques
+ // go all the way to the bottom.
+ const CGFloat kTopEdgeInset = 16;
+ const CGFloat kAlphaValueJustOpaqueEnough = 0.002;
+
+ scoped_nsobject<NSView> leftOpaque([[OpaqueView alloc] initWithFrame:
+ NSMakeRect(NSMinX(rootBounds), NSMinY(rootBounds),
+ 1, NSHeight(rootBounds) - kTopEdgeInset)]);
+ [leftOpaque setAutoresizingMask:NSViewMaxXMargin |
+ NSViewHeightSizable];
+ [leftOpaque setAlphaValue:kAlphaValueJustOpaqueEnough];
+ [rootView addSubview:leftOpaque];
+
+ scoped_nsobject<NSView> rightOpaque([[OpaqueView alloc] initWithFrame:
+ NSMakeRect(NSMaxX(rootBounds) - 1, NSMinY(rootBounds),
+ 1, NSHeight(rootBounds) - kTopEdgeInset)]);
+ [rightOpaque setAutoresizingMask:NSViewMinXMargin |
+ NSViewHeightSizable];
+ [rightOpaque setAlphaValue:kAlphaValueJustOpaqueEnough];
+ [rootView addSubview:rightOpaque];
}
}
diff --git a/webkit/plugins/npapi/plugin_host.cc b/webkit/plugins/npapi/plugin_host.cc
index 61d8e16..9a42090 100644
--- a/webkit/plugins/npapi/plugin_host.cc
+++ b/webkit/plugins/npapi/plugin_host.cc
@@ -838,10 +838,9 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) {
break;
}
case NPNVsupportsUpdatedCocoaTextInputBool: {
- // We support the clarifications to the Cocoa IME event spec, but since
- // IME currently only works on 10.6, only answer true there.
+ // We support the clarifications to the Cocoa IME event spec.
NPBool* supports_update = reinterpret_cast<NPBool*>(value);
- *supports_update = base::mac::IsOSSnowLeopardOrLater();
+ *supports_update = true;
rv = NPERR_NO_ERROR;
break;
}