1 // Copyright (c) 2010 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 #pragma once 8 9 #include "ui/gfx/size.h" 10 #include "views/view.h" 11 12 class GURL; 13 class PageActionImageView; 14 class TabContents; 15 16 // A container for the PageActionImageView plus its badge. 17 class PageActionWithBadgeView : public views::View { 18 public: 19 explicit PageActionWithBadgeView(PageActionImageView* image_view); 20 21 PageActionImageView* image_view() { return image_view_; } 22 23 // View overrides: 24 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 25 virtual gfx::Size GetPreferredSize() OVERRIDE; 26 27 void UpdateVisibility(TabContents* contents, const GURL& url); 28 29 private: 30 virtual void Layout(); 31 32 // The button this view contains. 33 PageActionImageView* image_view_; 34 35 DISALLOW_COPY_AND_ASSIGN(PageActionWithBadgeView); 36 }; 37 38 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_WITH_BADGE_VIEW_H_ 39