| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_VIEWS_BROWSER_ACTIONS_PANEL_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_BROWSER_ACTIONS_PANEL_H_ |
| 6 #define CHROME_BROWSER_VIEWS_BROWSER_ACTIONS_PANEL_H_ | 6 #define CHROME_BROWSER_VIEWS_BROWSER_ACTIONS_PANEL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "chrome/common/notification_observer.h" | 10 #include "chrome/common/notification_observer.h" |
| 11 #include "chrome/common/notification_registrar.h" | 11 #include "chrome/common/notification_registrar.h" |
| 12 #include "views/view.h" | 12 #include "views/view.h" |
| 13 | 13 |
| 14 class BrowserActionImageView; |
| 14 class ExtensionAction; | 15 class ExtensionAction; |
| 15 class Profile; | 16 class Profile; |
| 16 class ToolbarView; | 17 class ToolbarView; |
| 17 namespace views { | |
| 18 class TextButton; | |
| 19 } | |
| 20 | 18 |
| 21 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
| 22 // | 20 // |
| 23 // The BrowserActionsContainer is a container view, responsible for drawing the | 21 // The BrowserActionsContainer is a container view, responsible for drawing the |
| 24 // icons that represent browser actions (extensions that add icons to the | 22 // icons that represent browser actions (extensions that add icons to the |
| 25 // toolbar). | 23 // toolbar). |
| 26 // | 24 // |
| 27 //////////////////////////////////////////////////////////////////////////////// | 25 //////////////////////////////////////////////////////////////////////////////// |
| 28 class BrowserActionsContainer : public views::View, | 26 class BrowserActionsContainer : public views::View, |
| 29 public NotificationObserver { | 27 public NotificationObserver { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 52 // Overridden from NotificationObserver: | 50 // Overridden from NotificationObserver: |
| 53 virtual void Observe(NotificationType type, | 51 virtual void Observe(NotificationType type, |
| 54 const NotificationSource& source, | 52 const NotificationSource& source, |
| 55 const NotificationDetails& details); | 53 const NotificationDetails& details); |
| 56 | 54 |
| 57 private: | 55 private: |
| 58 // We override PaintChildren so that we can paint the badges on top of them. | 56 // We override PaintChildren so that we can paint the badges on top of them. |
| 59 virtual void PaintChildren(gfx::Canvas* canvas); | 57 virtual void PaintChildren(gfx::Canvas* canvas); |
| 60 | 58 |
| 61 // Paints an individual badge. | 59 // Paints an individual badge. |
| 62 virtual void PaintBadge(gfx::Canvas* canvas, views::TextButton* button, | 60 virtual void PaintBadge(gfx::Canvas* canvas, BrowserActionImageView* button, |
| 63 const SkColor& badge_color, | 61 const SkColor& badge_color, |
| 64 const std::string& text); | 62 const std::string& text); |
| 65 | 63 |
| 66 // The vector of browser actions (icons/image buttons for each action). | 64 // The vector of browser actions (icons/image buttons for each action). |
| 67 std::vector<views::TextButton*> browser_action_views_; | 65 std::vector<BrowserActionImageView*> browser_action_views_; |
| 68 | 66 |
| 69 NotificationRegistrar registrar_; | 67 NotificationRegistrar registrar_; |
| 70 | 68 |
| 71 Profile* profile_; | 69 Profile* profile_; |
| 72 | 70 |
| 73 // The toolbar that owns us. | 71 // The toolbar that owns us. |
| 74 ToolbarView* toolbar_; | 72 ToolbarView* toolbar_; |
| 75 | 73 |
| 76 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); | 74 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); |
| 77 }; | 75 }; |
| 78 | 76 |
| 79 #endif // CHROME_BROWSER_VIEWS_BROWSER_ACTIONS_PANEL_H_ | 77 #endif // CHROME_BROWSER_VIEWS_BROWSER_ACTIONS_PANEL_H_ |
| OLD | NEW |