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

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

Issue 10494004: Implements a zoom icon in the Omnibox for Views. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed messed up indentation Created 8 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_view.h
diff --git a/chrome/browser/ui/views/location_bar/zoom_view.h b/chrome/browser/ui/views/location_bar/zoom_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..d5ce668f0c694559593607e85ff58e27bfcd09cf
--- /dev/null
+++ b/chrome/browser/ui/views/location_bar/zoom_view.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_
+#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "chrome/browser/ui/zoom/zoom_controller.h"
+#include "ui/views/controls/image_view.h"
+
+namespace views {
+class KeyEvent;
+class MouseEvent;
+}
+
+// View for the zoom icon in the Omnibox.
+class ZoomView : public views::ImageView {
+ public:
+ ZoomView();
+ virtual ~ZoomView();
+
+ void SetZoomIconState(ZoomController::ZoomIconState zoom_icon_state);
+ void SetZoomIconTooltipPercent(int zoom_percent);
+
+ void Update();
Peter Kasting 2012/06/22 20:16:20 Nit: Add comments
Kyle Horimoto 2012/06/26 21:55:53 Done.
+ private:
Peter Kasting 2012/06/22 20:16:20 Nit: Add blank line above
Kyle Horimoto 2012/06/26 21:55:53 Done.
+ // views::ImageView overrides:
+ virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
+ virtual bool GetTooltipText(const gfx::Point& p,
+ string16* tooltip) const OVERRIDE;
+ virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE;
+ virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE;
+ virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE;
+
+ // The current icon state.
+ ZoomController::ZoomIconState zoom_icon_state_;
+
+ // The current zoom percentage.
+ int zoom_percent_;
+
+ DISALLOW_COPY_AND_ASSIGN(ZoomView);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698