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

Unified Diff: chrome/browser/ui/views/location_bar/zoom_bubble_view.h

Issue 16998006: Add handling for immersive fullscreen to the zoom bubble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ZoomBubbleBrowserTest.NonImmersiveFullscreen Created 7 years, 6 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/views/location_bar/zoom_bubble_view.h
diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view.h b/chrome/browser/ui/views/location_bar/zoom_bubble_view.h
index 1bf4c8d6a5f0ae15f017c76090b82bdbb9672b43..bb057aced8df46c15e91b487f6fa6ceffce40214 100644
--- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.h
+++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.h
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/timer.h"
+#include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "ui/views/bubble/bubble_delegate.h"
@@ -24,7 +25,8 @@ class WebContents;
// View used to display the zoom percentage when it has changed.
class ZoomBubbleView : public views::BubbleDelegateView,
public views::ButtonListener,
- public content::NotificationObserver {
+ public content::NotificationObserver,
+ public ImmersiveModeController::Observer {
public:
// Shows the bubble and automatically closes it after a short time period if
// |auto_close| is true.
@@ -37,16 +39,22 @@ class ZoomBubbleView : public views::BubbleDelegateView,
// Whether the zoom bubble is currently showing.
static bool IsShowing();
+ // Returns the zoom bubble if the zoom bubble is showing. Returns NULL
+ // otherwise.
+ static const ZoomBubbleView* GetZoomBubbleForTest();
+
private:
ZoomBubbleView(views::View* anchor_view,
content::WebContents* web_contents,
bool auto_close,
+ ImmersiveModeController* immersive_mode_controller,
FullscreenController* fullscreen_controller);
virtual ~ZoomBubbleView();
- // Place the bubble in the top right (left in RTL) of the |screen_bounds| that
- // contain |web_contents_|'s browser window. Because the positioning is based
- // on the size of the bubble, this must be called after the bubble is created.
+ // If the bubble is not anchored to a view, places the bubble in the top
+ // right (left in RTL) of the |screen_bounds| that contain |web_contents_|'s
+ // browser window. Because the positioning is based on the size of the
+ // bubble, this must be called after the bubble is created.
void AdjustForFullscreen(const gfx::Rect& screen_bounds);
// Refreshes the bubble by changing the zoom percentage appropriately and
@@ -81,6 +89,10 @@ class ZoomBubbleView : public views::BubbleDelegateView,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // ImmersiveModeController::Observer methods.
+ virtual void OnImmersiveRevealStarted() OVERRIDE;
+ virtual void OnImmersiveModeControllerDestroyed() OVERRIDE;
+
// Singleton instance of the zoom bubble. The zoom bubble can only be shown on
// the active browser window, so there is no case in which it will be shown
// twice at the same time.
@@ -98,6 +110,15 @@ class ZoomBubbleView : public views::BubbleDelegateView,
// Whether the currently displayed bubble will automatically close.
bool auto_close_;
+ // The immersive mode controller for the BrowserView containing
+ // |web_contents_|.
+ // Not owned.
+ ImmersiveModeController* immersive_mode_controller_;
+
+ // Keeps the top-of-window views revealed (but does not initiate a reveal)
+ // when the bubble is visible in immersive fullscreen.
+ scoped_ptr<ImmersiveRevealedLock> immersive_reveal_lock_;
+
// Used to register for fullscreen change notifications.
content::NotificationRegistrar registrar_;

Powered by Google App Engine
This is Rietveld 408576698