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

Unified Diff: chrome/browser/ui/browser.cc

Issue 1133283006: [PermissionBubble] Handle ownership management x-platform. Base URL: https://chromium.googlesource.com/chromium/src.git@argfix
Patch Set: And remove the platform-specific stuff. Created 5 years, 7 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
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/cocoa/browser_window_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index c1556d9e1bb6c69324779bc9d7c71a1975e8835d..f6f280bea7cc0723b0089bb744a4eba928e15b05 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -135,6 +135,7 @@
#include "chrome/browser/ui/unload_controller.h"
#include "chrome/browser/ui/validation_message_bubble.h"
#include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
+#include "chrome/browser/ui/website_settings/permission_bubble_view.h"
#include "chrome/browser/ui/webui/signin/login_ui_service.h"
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
#include "chrome/browser/ui/window_sizer/window_sizer.h"
@@ -1066,6 +1067,8 @@ void Browser::ActiveTabChanged(WebContents* old_contents,
tab_strip_model_->GetActiveWebContents())->GetStatusText());
}
+ TransferPermissionBubble(old_contents, new_contents);
+
if (HasFindBarController()) {
find_bar_controller_->ChangeWebContents(new_contents);
find_bar_controller_->find_bar()->MoveWindowIfNecessary(gfx::Rect());
@@ -2517,6 +2520,26 @@ void Browser::UpdateBookmarkBarState(BookmarkBarStateChangeReason reason) {
BookmarkBar::DONT_ANIMATE_STATE_CHANGE);
}
+void Browser::TransferPermissionBubble(WebContents* old_contents,
+ WebContents* new_contents) {
+ // No need to manually remove the old bubble - the old manager
+ // will automatically close it.
+ PermissionBubbleManager* manager(nullptr);
+ if (old_contents) {
+ manager = PermissionBubbleManager::FromWebContents(old_contents);
+ if (manager)
+ manager->SetView(nullptr);
+ }
+
+ if (new_contents) {
+ if (!permission_bubble_.get())
+ permission_bubble_.reset(PermissionBubbleView::Create(this));
+ manager = PermissionBubbleManager::FromWebContents(new_contents);
+ if (manager)
+ manager->SetView(permission_bubble_.get());
+ }
+}
+
bool Browser::ShouldHideUIForFullscreen() const {
// Windows and GTK remove the top controls in fullscreen, but Mac and Ash
// keep the controls in a slide-down panel.
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/cocoa/browser_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698