| 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.
|
|
|