Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 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_TOOLBAR_SITE_CHIP_VIEW_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_SITE_CHIP_VIEW_H_ | |
| 7 | |
| 8 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | |
| 9 #include "chrome/browser/ui/views/toolbar/toolbar_button.h" | |
| 10 #include "ui/views/controls/button/button.h" | |
| 11 | |
| 12 class ToolbarView; | |
| 13 | |
| 14 namespace content { | |
| 15 class WebContents; | |
| 16 } | |
| 17 | |
| 18 namespace gfx { | |
| 19 class Canvas; | |
| 20 } | |
| 21 | |
| 22 namespace views { | |
| 23 class Button; | |
| 24 class Label; | |
| 25 } | |
| 26 | |
| 27 class SiteChipView : public ToolbarButton, | |
| 28 public views::ButtonListener { | |
| 29 public: | |
| 30 explicit SiteChipView(ToolbarView* toolbar_view); | |
| 31 virtual ~SiteChipView(); | |
| 32 | |
| 33 void Init(); | |
| 34 | |
| 35 // Return whether the Site Chip should be shown in the toolbar. | |
|
Peter Kasting
2013/12/03 23:04:52
Nit: Return -> Returns, and similar changes to any
Greg Billock
2013/12/04 00:33:34
Done.
| |
| 36 bool ShouldShow(); | |
| 37 | |
| 38 // Recalculate the contents of the Site Chip based on the displayed tab. | |
| 39 void Update(content::WebContents* tab); | |
| 40 | |
| 41 views::ImageView* location_icon_view() { return location_icon_view_; } | |
| 42 | |
| 43 // ToolbarButton: | |
| 44 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
| 45 virtual void Layout() OVERRIDE; | |
| 46 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | |
| 47 | |
| 48 // views::ButtonListener: | |
| 49 virtual void ButtonPressed(views::Button* sender, | |
| 50 const ui::Event& event) OVERRIDE; | |
| 51 | |
| 52 private: | |
| 53 ToolbarView* toolbar_view_; | |
| 54 views::Label* host_label_; | |
| 55 LocationIconView* location_icon_view_; | |
| 56 scoped_ptr<views::Painter> background_painter_; | |
| 57 | |
| 58 DISALLOW_COPY_AND_ASSIGN(SiteChipView); | |
| 59 }; | |
| 60 | |
| 61 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_SITE_CHIP_VIEW_H_ | |
| OLD | NEW |