Commit d6cccd04 authored by rsesek@chromium.org's avatar rsesek@chromium.org

[Mac] Give info bubble windows a gaussian blur and a smaller border radius.

BUG=none
TEST=Visual. Bubbles look more up-to-date on later OSes.


Review URL: http://codereview.chromium.org/10272035

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134795 0039d316-1c4b-4281-b951-d872f2087c98
parent a65d1e4f
...@@ -467,11 +467,11 @@ const CGFloat kLabelInset = 49.0; ...@@ -467,11 +467,11 @@ const CGFloat kLabelInset = 49.0;
blue:246.0/255 blue:246.0/255
alpha:1.0]; alpha:1.0];
} else { } else {
backgroundColor = [NSColor whiteColor]; backgroundColor = [NSColor clearColor];
} }
[backgroundColor set]; [backgroundColor set];
NSRectFill([self bounds]); [NSBezierPath fillRect:[self bounds]];
} }
// Make sure the element is focusable for accessibility. // Make sure the element is focusable for accessibility.
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -12,7 +12,7 @@ namespace info_bubble { ...@@ -12,7 +12,7 @@ namespace info_bubble {
const CGFloat kBubbleArrowHeight = 8.0; const CGFloat kBubbleArrowHeight = 8.0;
const CGFloat kBubbleArrowWidth = 15.0; const CGFloat kBubbleArrowWidth = 15.0;
const CGFloat kBubbleCornerRadius = 8.0; const CGFloat kBubbleCornerRadius = 2.0;
const CGFloat kBubbleArrowXOffset = kBubbleArrowWidth + kBubbleCornerRadius; const CGFloat kBubbleArrowXOffset = kBubbleArrowWidth + kBubbleCornerRadius;
enum BubbleArrowLocation { enum BubbleArrowLocation {
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
[bezier lineToPoint:NSMakePoint(arrowStart.x + info_bubble::kBubbleArrowWidth, [bezier lineToPoint:NSMakePoint(arrowStart.x + info_bubble::kBubbleArrowWidth,
arrowStart.y)]; arrowStart.y)];
[bezier closePath]; [bezier closePath];
[[NSColor whiteColor] set]; [[NSColor colorWithCalibratedWhite:1.0 alpha:0.9] set];
[bezier fill]; [bezier fill];
} }
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/foundation_util.h"
#include "base/memory/scoped_nsobject.h" #include "base/memory/scoped_nsobject.h"
#include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_registrar.h"
...@@ -22,9 +23,28 @@ const NSTimeInterval kOrderOutAnimationDuration = 0.15; ...@@ -22,9 +23,28 @@ const NSTimeInterval kOrderOutAnimationDuration = 0.15;
// animation as quickly as possible. // animation as quickly as possible.
const NSTimeInterval kMinimumTimeInterval = const NSTimeInterval kMinimumTimeInterval =
std::numeric_limits<NSTimeInterval>::min(); std::numeric_limits<NSTimeInterval>::min();
} } // namespace
@interface InfoBubbleWindow(Private) // Forward declare private window server functions used to style the window.
extern "C" {
typedef int CGSConnection;
typedef int CGSWindow;
typedef void* CGSWindowFilterRef;
CGSConnection _CGSDefaultConnection();
CGError CGSNewCIFilterByName(CGSConnection cid,
CFStringRef filterName,
CGSWindowFilterRef *outFilter);
CGError CGSAddWindowFilter(CGSConnection cid,
CGSWindow wid,
CGSWindowFilterRef filter,
int flags);
CGError CGSReleaseCIFilter(CGSConnection cid, CGSWindowFilterRef filter);
CGError CGSSetCIFilterValuesFromDictionary(
CGSConnection cid, CGSWindowFilterRef filter, CFDictionaryRef filterValues);
} // extern "C"
@interface InfoBubbleWindow (Private)
- (void)appIsTerminating; - (void)appIsTerminating;
- (void)finishCloseAfterAnimation; - (void)finishCloseAfterAnimation;
@end @end
...@@ -202,6 +222,23 @@ class AppNotificationBridge : public content::NotificationObserver { ...@@ -202,6 +222,23 @@ class AppNotificationBridge : public content::NotificationObserver {
newOrigin.y += kOrderInSlideOffset; newOrigin.y += kOrderInSlideOffset;
[self setFrameOrigin:newOrigin]; [self setFrameOrigin:newOrigin];
// Add a gaussian blur to the window.
CGSConnection cgsConnection = _CGSDefaultConnection();
CGSWindowFilterRef filter;
if (CGSNewCIFilterByName(cgsConnection, CFSTR("CIGaussianBlur"),
&filter) == kCGErrorSuccess) {
NSDictionary* blurOptions =
[NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:1.5]
forKey:@"inputRadius"];
if (CGSSetCIFilterValuesFromDictionary(cgsConnection, filter,
base::mac::NSToCFCast(blurOptions)) == kCGErrorSuccess) {
CGSAddWindowFilter(cgsConnection, [self windowNumber], filter, 1);
}
CGSReleaseCIFilter(cgsConnection, filter);
}
// Apply animations to show and move self. // Apply animations to show and move self.
[NSAnimationContext beginGrouping]; [NSAnimationContext beginGrouping];
// The star currently triggers on mouse down, not mouse up. // The star currently triggers on mouse down, not mouse up.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment