| 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> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "chrome/common/extensions/api/extension_action/action_info.h" | 14 #include "chrome/common/extensions/api/extension_action/action_info.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
| 16 #include "ui/gfx/image/image.h" |
| 16 | 17 |
| 17 class GURL; | 18 class GURL; |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 class BrowserContext; | 21 class BrowserContext; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace extensions { | 24 namespace extensions { |
| 24 class Extension; | 25 class Extension; |
| 25 class IconImage; | 26 class IconImage; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 std::map<int, std::map<int, std::vector<gfx::Image> > > declarative_icon_; | 281 std::map<int, std::map<int, std::vector<gfx::Image> > > declarative_icon_; |
| 281 | 282 |
| 282 // ExtensionIconSet containing paths to bitmaps from which default icon's | 283 // ExtensionIconSet containing paths to bitmaps from which default icon's |
| 283 // image representations will be selected. | 284 // image representations will be selected. |
| 284 scoped_ptr<ExtensionIconSet> default_icon_; | 285 scoped_ptr<ExtensionIconSet> default_icon_; |
| 285 | 286 |
| 286 // The default icon image, if |default_icon_| exists. | 287 // The default icon image, if |default_icon_| exists. |
| 287 // Lazily initialized via LoadDefaultIconImage(). | 288 // Lazily initialized via LoadDefaultIconImage(). |
| 288 scoped_ptr<extensions::IconImage> default_icon_image_; | 289 scoped_ptr<extensions::IconImage> default_icon_image_; |
| 289 | 290 |
| 291 // The lazily-initialized image for a placeholder icon, in the event that the |
| 292 // extension doesn't have its own icon. (Mutable to allow lazy init in |
| 293 // GetDefaultIconImage().) |
| 294 mutable gfx::Image placeholder_icon_image_; |
| 295 |
| 290 // The id for the ExtensionAction, for example: "RssPageAction". This is | 296 // The id for the ExtensionAction, for example: "RssPageAction". This is |
| 291 // needed for compat with an older version of the page actions API. | 297 // needed for compat with an older version of the page actions API. |
| 292 std::string id_; | 298 std::string id_; |
| 293 | 299 |
| 294 DISALLOW_COPY_AND_ASSIGN(ExtensionAction); | 300 DISALLOW_COPY_AND_ASSIGN(ExtensionAction); |
| 295 }; | 301 }; |
| 296 | 302 |
| 297 template<> | 303 template<> |
| 298 struct ExtensionAction::ValueTraits<int> { | 304 struct ExtensionAction::ValueTraits<int> { |
| 299 static int CreateEmpty() { | 305 static int CreateEmpty() { |
| 300 return -1; | 306 return -1; |
| 301 } | 307 } |
| 302 }; | 308 }; |
| 303 | 309 |
| 304 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ | 310 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
| OLD | NEW |