summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bubble_controller.mm
diff options
context:
space:
mode:
authormrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-02 20:54:58 +0000
committermrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-02 20:54:58 +0000
commit195eef06359b185ce061d17aafd4e898fe02e8ee (patch)
tree0a5d9de0df046672feff8ccfee239d04523e67d1 /chrome/browser/cocoa/bookmark_bubble_controller.mm
parentd824a60fc2e91cd195c9722d6557a8038cf19503 (diff)
downloadchromium_src-195eef06359b185ce061d17aafd4e898fe02e8ee.zip
chromium_src-195eef06359b185ce061d17aafd4e898fe02e8ee.tar.gz
chromium_src-195eef06359b185ce061d17aafd4e898fe02e8ee.tar.bz2
Insure that the bookmark bubble comes up properly aligned when the browser is in full-screen mode and the floating bar is not showing by having the floating bar come up.
BUG=39428 TEST=1) Enter full-screen mode. Press Cmd-D and verify that the floating bar appears and that the bubble is properly aligned. Press 'Remove' and verify that the floating bar goes away. Repeat but this time press 'Done'. Repeat once again and this time press 'Edit' and verify that the bubble goes away but the floating bar remains until the bookmark editor is dismissed with the editor pane appearsing off the bottom of the floating bar. 2) Exit full-screen mode and perform the above exercises to insure that the bookmark bubble and bookmark edit window are still presented as expected: Press Cmd-D and verify that the bubble is properly aligned. Press 'Remove' and verify that the bubble goes away. Repeat but this time press 'Done'. Repeat once again and this time press 'Edit' and verify that the bubble goes and that the bookmark editor pane is presented off the bottom of the Chrome toolbar. Review URL: http://codereview.chromium.org/1539011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43519 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bubble_controller.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_bubble_controller.mm14
1 files changed, 11 insertions, 3 deletions
diff --git a/chrome/browser/cocoa/bookmark_bubble_controller.mm b/chrome/browser/cocoa/bookmark_bubble_controller.mm
index e59d1f6..c3b7cd0 100644
--- a/chrome/browser/cocoa/bookmark_bubble_controller.mm
+++ b/chrome/browser/cocoa/bookmark_bubble_controller.mm
@@ -7,6 +7,7 @@
#include "base/mac_util.h"
#include "base/sys_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
+#import "chrome/browser/cocoa/browser_window_controller.h"
#import "chrome/browser/cocoa/info_bubble_view.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "grit/generated_resources.h"
@@ -39,7 +40,6 @@
}
- (id)initWithParentWindow:(NSWindow*)parentWindow
- topRightForBubble:(NSPoint)topRightForBubble
model:(BookmarkModel*)model
node:(const BookmarkNode*)node
alreadyBookmarked:(BOOL)alreadyBookmarked {
@@ -48,7 +48,6 @@
ofType:@"nib"];
if ((self = [super initWithWindowNibPath:nibPath owner:self])) {
parentWindow_ = parentWindow;
- topRightForBubble_ = topRightForBubble;
model_ = model;
node_ = node;
alreadyBookmarked_ = alreadyBookmarked;
@@ -95,8 +94,15 @@
// position). We cannot have an addChildWindow: and a subsequent
// showWindow:. Thus, we have our own version.
- (void)showWindow:(id)sender {
+ BrowserWindowController* bwc =
+ [BrowserWindowController browserWindowControllerForWindow:parentWindow_];
+ [bwc lockBarVisibilityForOwner:self withAnimation:NO delay:NO];
NSWindow* window = [self window]; // completes nib load
- NSPoint origin = [parentWindow_ convertBaseToScreen:topRightForBubble_];
+ // Insure decent positioning even in the absence of a browser controller,
+ // which will occur for some unit tests.
+ NSPoint topRight = bwc ? [bwc topRightForBubble] :
+ NSMakePoint([window frame].size.width, [window frame].size.height);
+ NSPoint origin = [parentWindow_ convertBaseToScreen:topRight];
origin.y -= NSHeight([window frame]);
origin.x -= NSWidth([window frame]);
[window setFrameOrigin:origin];
@@ -125,6 +131,8 @@
}
- (void)close {
+ [[BrowserWindowController browserWindowControllerForWindow:parentWindow_]
+ releaseBarVisibilityForOwner:self withAnimation:YES delay:NO];
[parentWindow_ removeChildWindow:[self window]];
// If you quit while the bubble is open, sometimes we get a