| 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_EXTENSIONS_EXTENSION_ACTION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 if (const bool* default_is_visible = | 172 if (const bool* default_is_visible = |
| 173 FindOrNull(&is_visible_, kDefaultTabId)) | 173 FindOrNull(&is_visible_, kDefaultTabId)) |
| 174 return *default_is_visible; | 174 return *default_is_visible; |
| 175 | 175 |
| 176 return false; | 176 return false; |
| 177 } | 177 } |
| 178 | 178 |
| 179 // Remove all tab-specific state. | 179 // Remove all tab-specific state. |
| 180 void ClearAllValuesForTab(int tab_id); | 180 void ClearAllValuesForTab(int tab_id); |
| 181 | 181 |
| 182 // If the specified tab has a badge, paint it into the provided bounds. | |
| 183 void PaintBadge(gfx::Canvas* canvas, const gfx::Rect& bounds, int tab_id); | |
| 184 | |
| 185 // Returns icon image with badge for specified tab. | |
| 186 gfx::ImageSkia GetIconWithBadge(const gfx::ImageSkia& icon, | |
| 187 int tab_id, | |
| 188 const gfx::Size& spacing) const; | |
| 189 | |
| 190 // Lazily loads and returns the default icon image, if one exists for the | 182 // Lazily loads and returns the default icon image, if one exists for the |
| 191 // action. | 183 // action. |
| 192 extensions::IconImage* LoadDefaultIconImage( | 184 extensions::IconImage* LoadDefaultIconImage( |
| 193 const extensions::Extension& extension, | 185 const extensions::Extension& extension, |
| 194 content::BrowserContext* browser_context); | 186 content::BrowserContext* browser_context); |
| 195 | 187 |
| 196 // Returns the image to use as the default icon for the action. Can only be | 188 // Returns the image to use as the default icon for the action. Can only be |
| 197 // called after LoadDefaultIconImage(). | 189 // called after LoadDefaultIconImage(). |
| 198 gfx::Image GetDefaultIconImage() const; | 190 gfx::Image GetDefaultIconImage() const; |
| 199 | 191 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 }; | 295 }; |
| 304 | 296 |
| 305 template<> | 297 template<> |
| 306 struct ExtensionAction::ValueTraits<int> { | 298 struct ExtensionAction::ValueTraits<int> { |
| 307 static int CreateEmpty() { | 299 static int CreateEmpty() { |
| 308 return -1; | 300 return -1; |
| 309 } | 301 } |
| 310 }; | 302 }; |
| 311 | 303 |
| 312 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ | 304 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
| OLD | NEW |