Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3637)

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller_private.mm

Issue 1292353006: Mac Changes for BubbleManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mcdb-mac-3.gitbr
Patch Set: New upstream Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser_window_controller_private.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
index 4d02ca5a9d775444404b2ad90fb15fccdfb5749f..feaabf3a2858ecf9bde5540f72c48c38b8d58549 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -22,6 +22,8 @@
#include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window_state.h"
+#include "chrome/browser/ui/chrome_bubble_manager.h"
+#include "chrome/browser/ui/chrome_bubble_manager_factory.h"
#import "chrome/browser/ui/cocoa/browser_window_enter_fullscreen_transition.h"
#import "chrome/browser/ui/cocoa/browser_window_layout.h"
#import "chrome/browser/ui/cocoa/custom_frame_view.h"
@@ -232,9 +234,11 @@ willPositionSheet:(NSWindow*)sheet
// Will update the location of the permission bubble when showing/hiding the
// top level toolbar in fullscreen.
- PermissionBubbleManager* manager = [self permissionBubbleManager];
- if (manager)
- manager->UpdateAnchorPosition();
+ WebContents* contents = [self webContents];
+ if (contents) {
+ ChromeBubbleManagerFactory::GetForBrowserContext(browser_->profile())
+ ->UpdateAnchorPosition(contents);
+ }
}
- (void)applyTabStripLayout:(const chrome::TabStripLayout&)layout {
@@ -396,10 +400,8 @@ willPositionSheet:(NSWindow*)sheet
if (statusBubble_)
statusBubble_->SwitchParentWindow(destWindow);
- // Updates the bubble position.
- PermissionBubbleManager* manager = [self permissionBubbleManager];
- if (manager)
- manager->UpdateAnchorPosition();
+ ChromeBubbleManagerFactory::GetForBrowserContext(browser_->profile())
+ ->FullscreenToggle([self webContents]);
// Move the title over.
[destWindow setTitle:[sourceWindow title]];
@@ -446,6 +448,13 @@ willPositionSheet:(NSWindow*)sheet
BOOL showDropdown =
!fullscreen_for_tab && !kiosk_mode && ([self floatingBarHasFocus]);
+ /*
+ * TODO(hcarmona): This code needs to know about the bubble window...
+ * This is very specific to bubbles that survive fullscreen transition that
+ * also have an anchor on the location bar. Not sure if this should be handled
+ * by the bubble manager or if the bubble manager should expose the bubble
+ * window to its callers for mac. Ideas?
+ *
PermissionBubbleManager* manager = [self permissionBubbleManager];
if (manager && manager->IsBubbleVisible()) {
NSWindow* bubbleWindow = manager->GetBubbleWindow();
@@ -462,6 +471,7 @@ willPositionSheet:(NSWindow*)sheet
name:NSWindowWillCloseNotification
object:bubbleWindow];
}
+ */
if (showDropdown) {
// Turn on layered mode for the window's root view for the entry
@@ -1118,10 +1128,4 @@ willPositionSheet:(NSWindow*)sheet
return browser_->tab_strip_model()->GetActiveWebContents();
}
-- (PermissionBubbleManager*)permissionBubbleManager {
- if (WebContents* contents = [self webContents])
- return PermissionBubbleManager::FromWebContents(contents);
- return nil;
-}
-
@end // @implementation BrowserWindowController(Private)

Powered by Google App Engine
This is Rietveld 408576698