Chromium Code Reviews| 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..cd5bdbe6deea1ece42d4574797c3aa87f47c5bf7 |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.h |
| @@ -0,0 +1,49 @@ |
| +// 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: |
| + // Shows the bubble and automatically closes it after a short time period if |
| + // |auto_close| is true. |
| + static void ShowBubble(views::View* anchor_view, |
| + int zoom_percent, |
| + bool auto_close); |
| + static void CloseBubble(); |
| + static bool IsShowing(); |
| + |
| + // views::WidgetDelegate method. |
|
Peter Kasting
2012/06/22 20:16:20
Nit: Since this doesn't inherit directly from view
Kyle Horimoto
2012/06/26 21:55:53
Done.
|
| + virtual void WindowClosing() OVERRIDE; |
| + |
| + protected: |
| + // views::BubbleDelegateView method. |
| + virtual void Init() OVERRIDE; |
|
Peter Kasting
2012/06/22 20:16:20
Nit: No one overrides this class, right? So this
Kyle Horimoto
2012/06/26 21:55:53
Done.
|
| + |
| + private: |
| + ZoomBubbleView(views::View* anchor_view, |
| + int zoom_percent, |
| + bool auto_close); |
| + virtual ~ZoomBubbleView(); |
| + |
| + void Close(); |
| + |
| + static ZoomBubbleView* zoom_bubble_; |
| + |
| + base::WeakPtrFactory<ZoomBubbleView> factory_; |
| + |
| + int zoom_percent_; |
| + bool auto_close_; |
| + views::Label* zoom_percent_label_; |
| +}; |
|
Ben Goodger (Google)
2012/06/22 19:16:06
DISALLOW_COPY_AND_ASSIGN(..
Kyle Horimoto
2012/06/26 21:55:53
Done.
|
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_ |