| 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_COMMON_EXTENSIONS_EXTENSION_ACTION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_ACTION_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_ACTION_H_ | 6 #define CHROME_COMMON_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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 171 |
| 172 // Set this action's icon bitmap on a specific tab. | 172 // Set this action's icon bitmap on a specific tab. |
| 173 void SetIcon(int tab_id, const gfx::Image& image); | 173 void SetIcon(int tab_id, const gfx::Image& image); |
| 174 | 174 |
| 175 // Get the icon for a tab, or the default if no icon was set for this tab, | 175 // Get the icon for a tab, or the default if no icon was set for this tab, |
| 176 // retrieving icons that have been specified by path from the previous | 176 // retrieving icons that have been specified by path from the previous |
| 177 // arguments to CacheIcon(). If the default icon isn't found in the cache, | 177 // arguments to CacheIcon(). If the default icon isn't found in the cache, |
| 178 // returns the puzzle piece icon. | 178 // returns the puzzle piece icon. |
| 179 gfx::Image GetIcon(int tab_id) const; | 179 gfx::Image GetIcon(int tab_id) const; |
| 180 | 180 |
| 181 // Gets the icon that has been set using |SetIcon| for the tab. |
| 182 gfx::ImageSkia GetExplicitlySetIcon(int tab_id) const; |
| 183 |
| 181 // Set this action's icon index for a specific tab. For use with | 184 // Set this action's icon index for a specific tab. For use with |
| 182 // icon_paths(), only used in page actions. | 185 // icon_paths(), only used in page actions. |
| 183 void SetIconIndex(int tab_id, int index); | 186 void SetIconIndex(int tab_id, int index); |
| 184 | 187 |
| 185 // Get this action's icon index for a tab, or the default if no icon index | 188 // Get this action's icon index for a tab, or the default if no icon index |
| 186 // was set. | 189 // was set. |
| 187 int GetIconIndex(int tab_id) const { | 190 int GetIconIndex(int tab_id) const { |
| 188 return GetValue(&icon_index_, tab_id); | 191 return GetValue(&icon_index_, tab_id); |
| 189 } | 192 } |
| 190 | 193 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 }; | 348 }; |
| 346 | 349 |
| 347 template<> | 350 template<> |
| 348 struct ExtensionAction::ValueTraits<int> { | 351 struct ExtensionAction::ValueTraits<int> { |
| 349 static int CreateEmpty() { | 352 static int CreateEmpty() { |
| 350 return -1; | 353 return -1; |
| 351 } | 354 } |
| 352 }; | 355 }; |
| 353 | 356 |
| 354 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_ACTION_H_ | 357 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_ACTION_H_ |
| OLD | NEW |