OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_BROWSER_ACTION_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_BROWSER_ACTION_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_BROWSER_ACTION_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_BROWSER_ACTION_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/extensions/image_loading_tracker.h" | 10 #include "chrome/browser/extensions/image_loading_tracker.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 virtual ~Delegate() {} | 57 virtual ~Delegate() {} |
58 }; | 58 }; |
59 | 59 |
60 BrowserActionView(const extensions::Extension* extension, | 60 BrowserActionView(const extensions::Extension* extension, |
61 Browser* browser, | 61 Browser* browser, |
62 Delegate* delegate); | 62 Delegate* delegate); |
63 virtual ~BrowserActionView(); | 63 virtual ~BrowserActionView(); |
64 | 64 |
65 BrowserActionButton* button() { return button_; } | 65 BrowserActionButton* button() { return button_; } |
66 | 66 |
67 // Allocates a canvas object on the heap and draws into it the icon for the | 67 // Gets browser action button icon with the badge. |
68 // view as well as the badge (if any). Caller is responsible for deleting the | 68 gfx::ImageSkia GetIconWithBadge(); |
69 // returned object. | |
70 gfx::Canvas* GetIconWithBadge(); | |
71 | 69 |
72 // Overridden from views::View: | 70 // Overridden from views::View: |
73 virtual void Layout() OVERRIDE; | 71 virtual void Layout() OVERRIDE; |
74 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 72 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
75 virtual gfx::Size GetPreferredSize() OVERRIDE; | 73 virtual gfx::Size GetPreferredSize() OVERRIDE; |
76 | 74 |
77 protected: | 75 protected: |
78 // Overridden from views::View to paint the badge on top of children. | 76 // Overridden from views::View to paint the badge on top of children. |
79 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; | 77 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; |
80 virtual void ViewHierarchyChanged(bool is_add, | 78 virtual void ViewHierarchyChanged(bool is_add, |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 218 |
221 // Responsible for running the menu. | 219 // Responsible for running the menu. |
222 scoped_ptr<views::MenuRunner> menu_runner_; | 220 scoped_ptr<views::MenuRunner> menu_runner_; |
223 | 221 |
224 friend class base::DeleteHelper<BrowserActionButton>; | 222 friend class base::DeleteHelper<BrowserActionButton>; |
225 | 223 |
226 DISALLOW_COPY_AND_ASSIGN(BrowserActionButton); | 224 DISALLOW_COPY_AND_ASSIGN(BrowserActionButton); |
227 }; | 225 }; |
228 | 226 |
229 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTION_VIEW_H_ | 227 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTION_VIEW_H_ |
OLD | NEW |