summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/info_bubble_window.mm
diff options
context:
space:
mode:
authorandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-12 05:18:50 +0000
committerandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-12 05:18:50 +0000
commitd64f2a0ea7adada3e5221782e4739a9b858c53fd (patch)
tree08ca665b6c99e92bc12217dad7db5ed016bfca51 /chrome/browser/cocoa/info_bubble_window.mm
parent87eacb992a5fcc517a29a7097937df217b6839ff (diff)
downloadchromium_src-d64f2a0ea7adada3e5221782e4739a9b858c53fd.zip
chromium_src-d64f2a0ea7adada3e5221782e4739a9b858c53fd.tar.gz
chromium_src-d64f2a0ea7adada3e5221782e4739a9b858c53fd.tar.bz2
o Renames the bookmark bubble class to InfoBubble in a step to make it more reusable.
o Adds the ability to position the arrow of the bubble on the top right as well as the top left (default). BUG=none TEST=Nothing should change visually. This is prep for use by browser action popups and the first run UI. Review URL: http://codereview.chromium.org/385060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/info_bubble_window.mm')
-rw-r--r--chrome/browser/cocoa/info_bubble_window.mm36
1 files changed, 36 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/info_bubble_window.mm b/chrome/browser/cocoa/info_bubble_window.mm
new file mode 100644
index 0000000..9941c62
--- /dev/null
+++ b/chrome/browser/cocoa/info_bubble_window.mm
@@ -0,0 +1,36 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "chrome/browser/cocoa/info_bubble_window.h"
+
+@implementation InfoBubbleWindow
+
+- (id)initWithContentRect:(NSRect)contentRect
+ styleMask:(NSUInteger)aStyle
+ backing:(NSBackingStoreType)bufferingType
+ defer:(BOOL)flag {
+ if ((self = [super initWithContentRect:contentRect
+ styleMask:NSBorderlessWindowMask
+ backing:bufferingType
+ defer:flag])) {
+ [self setBackgroundColor:[NSColor clearColor]];
+ [self setExcludedFromWindowsMenu:YES];
+ [self setAlphaValue:1.0];
+ [self setOpaque:NO];
+ [self setHasShadow:YES];
+ }
+ return self;
+}
+
+// According to
+// http://www.cocoabuilder.com/archive/message/cocoa/2006/6/19/165953,
+// NSBorderlessWindowMask windows cannot become key or main. In our
+// case, however, we don't want all of that behavior. As an example,
+// our bubble could have buttons.
+
+- (BOOL)canBecomeKeyWindow {
+ return YES;
+}
+
+@end