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

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

Issue 420533002: zoom bubble: Close if anchor is clicked while bubble is showing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 6 years, 2 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_view.h
diff --git a/chrome/browser/ui/views/location_bar/zoom_view.h b/chrome/browser/ui/views/location_bar/zoom_view.h
index bd732362893b2902210bfc179c863641e9ab219c..00746d208c29daad0840f9c91c625cb006cad681 100644
--- a/chrome/browser/ui/views/location_bar/zoom_view.h
+++ b/chrome/browser/ui/views/location_bar/zoom_view.h
@@ -5,21 +5,19 @@
#ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "chrome/browser/ui/views/location_bar/bubble_icon_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
-#include "ui/views/controls/image_view.h"
class ZoomController;
// View for the zoom icon in the Omnibox.
-class ZoomView : public views::ImageView {
+class ZoomView : public BubbleIconView {
public:
// Clicking on the ZoomView shows a ZoomBubbleView, which requires the current
// WebContents. Because the current WebContents changes as the user switches
- // tabs, it cannot be provided in the constructor. Instead, a
- // LocationBarView::Delegate is passed here so that it can be queried for the
- // current WebContents as needed.
+ // tabs, a LocationBarView::Delegate is supplied to queried for the current
+ // WebContents when needed.
explicit ZoomView(LocationBarView::Delegate* location_bar_delegate);
virtual ~ZoomView();
msw 2014/10/24 00:00:56 nit: remove "virtual" keywords here and below, use
Dan Beam 2014/10/24 00:26:19 Done. (mind == blown)
@@ -27,22 +25,13 @@ class ZoomView : public views::ImageView {
// as needed.
void Update(ZoomController* zoom_controller);
- private:
- // views::ImageView:
+ protected:
+ // BubbleIconView:
+ virtual bool IsBubbleShowing() const override;
+ virtual void OnExecuting(BubbleIconView::ExecuteSource source) override;
virtual void GetAccessibleState(ui::AXViewState* state) override;
- virtual bool GetTooltipText(const gfx::Point& p,
- base::string16* tooltip) const override;
- virtual bool OnMousePressed(const ui::MouseEvent& event) override;
- virtual void OnMouseReleased(const ui::MouseEvent& event) override;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
-
- // ui::EventHandler:
- virtual void OnGestureEvent(ui::GestureEvent* event) override;
-
- // Helper method to show and focus the zoom bubble associated with this
- // widget.
- void ActivateBubble();
+ private:
// The delegate used to get the currently visible WebContents.
LocationBarView::Delegate* location_bar_delegate_;

Powered by Google App Engine
This is Rietveld 408576698