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

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: Created 8 years, 7 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..e8d8a8f25c1d84093f41ce27d8eedb3f3e716d8d
--- /dev/null
+++ b/chrome/browser/ui/views/location_bar/zoom_view.h
@@ -0,0 +1,44 @@
+// 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 "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:
+ explicit ZoomView();
Ben Goodger (Google) 2012/06/04 15:16:49 -explicit
Kyle Horimoto 2012/06/05 05:03:59 Done.
+ virtual ~ZoomView();
+
+ void SetZoomIconState(ZoomController::ZoomIconState zoom_icon_state);
+ void SetZoomIconTooltipPercent(int zoom_percent);
+
+ private:
+ void Update();
+
+ // 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_;
+};
Ben Goodger (Google) 2012/06/04 15:16:49 DISALLOW_COPY_AND
Kyle Horimoto 2012/06/05 05:03:59 Done.
+
+#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698