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