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

Unified Diff: chrome/browser/ui/views/location_bar/zoom_bubble_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_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
new file mode 100644
index 0000000000000000000000000000000000000000..7dead0bc6c447e1512c534b56a31ac566821aaa9
--- /dev/null
+++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.h
@@ -0,0 +1,47 @@
+// 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_BUBBLE_VIEW_H_
+#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_
+#pragma once
+
+#include "base/memory/weak_ptr.h"
+#include "ui/views/bubble/bubble_delegate.h"
+#include "ui/views/controls/button/button.h"
+#include "ui/views/controls/label.h"
+
+// View used to display the zoom percentage when it has changed.
+class ZoomBubbleView : public views::BubbleDelegateView {
+ public:
+ static void ShowBubble(views::View* anchor_view,
+ int zoom_percent,
+ bool autoclose);
+ static void CloseBubble();
+ static bool IsShowing();
+
+ // views::WidgetDelegate method.
+ virtual void WindowClosing() OVERRIDE;
+
+ protected:
+ // views::BubbleDelegateView method.
+ virtual void Init() OVERRIDE;
+
+ private:
+ ZoomBubbleView(views::View* anchor_view,
+ int zoom_percent,
+ bool autoclose);
+ virtual ~ZoomBubbleView();
+
+ void Close();
+
+ static ZoomBubbleView* zoom_bubble_;
+
+ base::WeakPtrFactory<ZoomBubbleView> factory_;
+
+ int zoom_percent_;
+ bool autoclose_;
+ views::Label* zoom_percent_label_;
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698