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

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: 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..a82c03f4e431f34f8a39dd1a7ec8f4d372b1fec0 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);
groby-ooo-7-16 2015/08/14 18:26:04 Ideally, I'd like a way to do this platform-neutra
+ }
}
- (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,8 @@ willPositionSheet:(NSWindow*)sheet
BOOL showDropdown =
!fullscreen_for_tab && !kiosk_mode && ([self floatingBarHasFocus]);
+ /*
+ * TODO(hcarmona): bring this back
groby-ooo-7-16 2015/08/14 18:26:04 Well, that's kind of a huge part of the cocoa side
hcarmona 2015/08/18 02:22:21 Yes, it's a big part. How should we handle this? C
PermissionBubbleManager* manager = [self permissionBubbleManager];
if (manager && manager->IsBubbleVisible()) {
NSWindow* bubbleWindow = manager->GetBubbleWindow();
@@ -462,6 +466,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 +1123,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