| 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" | |
| 17 | 16 |
| 18 class GURL; | 17 class GURL; |
| 19 | 18 |
| 20 namespace content { | 19 namespace content { |
| 21 class BrowserContext; | 20 class BrowserContext; |
| 22 } | 21 } |
| 23 | 22 |
| 24 namespace extensions { | 23 namespace extensions { |
| 25 class Extension; | 24 class Extension; |
| 26 class IconImage; | 25 class IconImage; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 std::map<int, std::map<int, std::vector<gfx::Image> > > declarative_icon_; | 280 std::map<int, std::map<int, std::vector<gfx::Image> > > declarative_icon_; |
| 282 | 281 |
| 283 // ExtensionIconSet containing paths to bitmaps from which default icon's | 282 // ExtensionIconSet containing paths to bitmaps from which default icon's |
| 284 // image representations will be selected. | 283 // image representations will be selected. |
| 285 scoped_ptr<ExtensionIconSet> default_icon_; | 284 scoped_ptr<ExtensionIconSet> default_icon_; |
| 286 | 285 |
| 287 // The default icon image, if |default_icon_| exists. | 286 // The default icon image, if |default_icon_| exists. |
| 288 // Lazily initialized via LoadDefaultIconImage(). | 287 // Lazily initialized via LoadDefaultIconImage(). |
| 289 scoped_ptr<extensions::IconImage> default_icon_image_; | 288 scoped_ptr<extensions::IconImage> default_icon_image_; |
| 290 | 289 |
| 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 | |
| 296 // The id for the ExtensionAction, for example: "RssPageAction". This is | 290 // The id for the ExtensionAction, for example: "RssPageAction". This is |
| 297 // needed for compat with an older version of the page actions API. | 291 // needed for compat with an older version of the page actions API. |
| 298 std::string id_; | 292 std::string id_; |
| 299 | 293 |
| 300 DISALLOW_COPY_AND_ASSIGN(ExtensionAction); | 294 DISALLOW_COPY_AND_ASSIGN(ExtensionAction); |
| 301 }; | 295 }; |
| 302 | 296 |
| 303 template<> | 297 template<> |
| 304 struct ExtensionAction::ValueTraits<int> { | 298 struct ExtensionAction::ValueTraits<int> { |
| 305 static int CreateEmpty() { | 299 static int CreateEmpty() { |
| 306 return -1; | 300 return -1; |
| 307 } | 301 } |
| 308 }; | 302 }; |
| 309 | 303 |
| 310 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ | 304 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
| OLD | NEW |