Commit e831ec34 authored by pkotwicz@chromium.org's avatar pkotwicz@chromium.org

Reveal the toolbar (and the remainder of the top chrome) for:

  - The bubble which notifies the extension is installed
  - The bubble for browser actions and page actions.
The bubbles are anchored to the toolbar so not showing the top chrome when the bubbles are visible is weird.

BUG=250708
TEST=Manual

Review URL: https://chromiumcodereview.appspot.com/17293003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207952 0039d316-1c4b-4281-b951-d872f2087c98
parent d2e2ccf2
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "chrome/browser/ui/views/browser_action_view.h" #include "chrome/browser/ui/views/browser_action_view.h"
#include "chrome/browser/ui/views/browser_actions_container.h" #include "chrome/browser/ui/views/browser_actions_container.h"
#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/tabs/tab_strip.h" #include "chrome/browser/ui/views/tabs/tab_strip.h"
#include "chrome/browser/ui/views/toolbar_view.h" #include "chrome/browser/ui/views/toolbar_view.h"
...@@ -653,6 +654,15 @@ void ExtensionInstalledBubble::ShowInternal() { ...@@ -653,6 +654,15 @@ void ExtensionInstalledBubble::ShowInternal() {
SetLayoutManager(new views::FillLayout()); SetLayoutManager(new views::FillLayout());
AddChildView( AddChildView(
new InstalledBubbleContent(browser_, extension_, type_, &icon_, this)); new InstalledBubbleContent(browser_, extension_, type_, &icon_, this));
// If we are in immersive fullscreen, reveal the top-of-window views
// (omnibox, toolbar) so that the view the bubble is anchored to is visible.
// We do not need to hold onto the lock because ImmersiveModeController will
// keep the top-of-window views revealed as long as the popup is active.
// TODO(pkotwicz): Move logic to ImmersiveModeController.
scoped_ptr<ImmersiveRevealedLock> immersive_reveal_lock(
browser_view->immersive_mode_controller()->GetRevealedLock(
ImmersiveModeController::ANIMATE_REVEAL_NO));
views::BubbleDelegateView::CreateBubble(this); views::BubbleDelegateView::CreateBubble(this);
// The bubble widget is now the parent and owner of |this| and takes care of // The bubble widget is now the parent and owner of |this| and takes care of
......
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
#include "chrome/browser/ui/views/frame/top_container_view.h"
#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/devtools_agent_host.h" #include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_manager.h" #include "content/public/browser/devtools_manager.h"
...@@ -67,6 +70,7 @@ ExtensionPopup::ExtensionPopup(Browser* browser, ...@@ -67,6 +70,7 @@ ExtensionPopup::ExtensionPopup(Browser* browser,
views::BubbleBorder::Arrow arrow, views::BubbleBorder::Arrow arrow,
ShowAction show_action) ShowAction show_action)
: BubbleDelegateView(anchor_view, arrow), : BubbleDelegateView(anchor_view, arrow),
browser_(browser),
extension_host_(host), extension_host_(host),
devtools_callback_(base::Bind( devtools_callback_(base::Bind(
&ExtensionPopup::OnDevToolsStateChanged, base::Unretained(this))) { &ExtensionPopup::OnDevToolsStateChanged, base::Unretained(this))) {
...@@ -193,6 +197,21 @@ ExtensionPopup* ExtensionPopup::ShowPopup(const GURL& url, ...@@ -193,6 +197,21 @@ ExtensionPopup* ExtensionPopup::ShowPopup(const GURL& url,
} }
void ExtensionPopup::ShowBubble() { void ExtensionPopup::ShowBubble() {
BrowserView* browser_view = browser_ ?
BrowserView::GetBrowserViewForBrowser(browser_) : NULL;
scoped_ptr<ImmersiveRevealedLock> immersive_reveal_lock;
if (browser_view &&
browser_view->top_container()->Contains(anchor_view())) {
// If we are in immersive fullscreen and we are anchored to a view in the
// top-of-window views (eg omnibox, toolbar), trigger an immersive reveal.
// We do not need to hold onto the lock because ImmersiveModeController will
// keep the top-of-window views revealed as long as the popup is active.
// TODO(pkotwicz): Move logic to ImmersiveModeController.
immersive_reveal_lock.reset(
browser_view->immersive_mode_controller()->GetRevealedLock(
ImmersiveModeController::ANIMATE_REVEAL_NO));
SizeToContents();
}
GetWidget()->Show(); GetWidget()->Show();
// Focus on the host contents when the bubble is first shown. // Focus on the host contents when the bubble is first shown.
......
...@@ -84,6 +84,9 @@ class ExtensionPopup : public views::BubbleDelegateView, ...@@ -84,6 +84,9 @@ class ExtensionPopup : public views::BubbleDelegateView,
void OnDevToolsStateChanged(content::DevToolsAgentHost*, bool attached); void OnDevToolsStateChanged(content::DevToolsAgentHost*, bool attached);
// The browser to which the popup is anchored. Not owned.
Browser* browser_;
// The contained host for the view. // The contained host for the view.
scoped_ptr<extensions::ExtensionHost> extension_host_; scoped_ptr<extensions::ExtensionHost> extension_host_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment