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

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

Issue 10792020: Implements the "Set to default" button on the zoom bubble. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed .gitmodules, oops Created 8 years, 4 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 2c5062244cbd9339566db1ab8ee383c37ff314e3..4ccf829d8505351bd3b29cca2d12f77c7c83e59e 100644
--- a/chrome/browser/ui/views/location_bar/zoom_view.h
+++ b/chrome/browser/ui/views/location_bar/zoom_view.h
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "chrome/browser/ui/toolbar/toolbar_model.h"
+#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/zoom/zoom_controller.h"
#include "ui/views/controls/image_view.h"
@@ -18,7 +19,13 @@ class MouseEvent;
// View for the zoom icon in the Omnibox.
class ZoomView : public views::ImageView {
public:
- explicit ZoomView(ToolbarModel* toolbar_model);
+ // Constructor for ZoomView. Clicking on the ZoomView shows a ZoomBubbleView,
+ // which requires the current TabContents. Because the current TabContents
+ // 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 TabContents as needed.
+ ZoomView(ToolbarModel* toolbar_model,
+ LocationBarView::Delegate* location_bar_delegate);
virtual ~ZoomView();
void SetZoomIconState(ZoomController::ZoomIconState zoom_icon_state);
@@ -40,6 +47,9 @@ class ZoomView : public views::ImageView {
// Toolbar model used to test whether location bar input is in progress.
ToolbarModel* toolbar_model_;
+ // The delegate used to get the currently visible TabContents.
+ LocationBarView::Delegate* location_bar_delegate_;
+
// The current icon state.
ZoomController::ZoomIconState zoom_icon_state_;

Powered by Google App Engine
This is Rietveld 408576698