page_action_with_badge_view.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_WITH_BADGE_VIEW_H_
6#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_WITH_BADGE_VIEW_H_
7
8#include "base/compiler_specific.h"
9#include "chrome/browser/ui/views/location_bar/touchable_location_bar_view.h"
10#include "ui/gfx/size.h"
11#include "ui/views/view.h"
12
13class GURL;
14class PageActionImageView;
15
16namespace content {
17class WebContents;
18}
19
20// A container for the PageActionImageView plus its badge.
21class PageActionWithBadgeView
22    : public views::View,
23      public TouchableLocationBarView {
24 public:
25  explicit PageActionWithBadgeView(PageActionImageView* image_view);
26
27  PageActionImageView* image_view() { return image_view_; }
28
29  // View overrides:
30  virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
31  virtual gfx::Size GetPreferredSize() OVERRIDE;
32
33  // TouchableLocationBarView.
34  virtual int GetBuiltInHorizontalPadding() const OVERRIDE;
35
36  void UpdateVisibility(content::WebContents* contents, const GURL& url);
37
38 private:
39  virtual void Layout() OVERRIDE;
40
41  // The button this view contains.
42  PageActionImageView* image_view_;
43
44  DISALLOW_COPY_AND_ASSIGN(PageActionWithBadgeView);
45};
46
47#endif  // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_WITH_BADGE_VIEW_H_
48