Chromium Code Reviews| Index: chrome/browser/extensions/extension_action_icon_factory.h |
| diff --git a/chrome/browser/extensions/extension_action_icon_factory.h b/chrome/browser/extensions/extension_action_icon_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b07c6e01047714f78a2cc4499af56f1931776996 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/extension_action_icon_factory.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_ICON_FACTORY_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_ICON_FACTORY_H_ |
| + |
| +#include "chrome/common/extensions/extension_action.h" |
| + |
| +class ExtensionActionIcon; |
| +class ExtensionIconSet; |
| + |
| +namespace extensions { |
| +class Extension; |
| +} |
| + |
| +class ExtensionActionIconFactory : public ExtensionAction::IconFactory { |
|
Jeffrey Yasskin
2012/09/01 03:54:33
Comment what this is for.
Also, terribly confusin
tbarzic
2012/09/05 01:05:29
Done.
|
| + public: |
| + class Observer { |
| + public: |
| + virtual ~Observer() {} |
| + virtual void OnIconUpdated() = 0; |
| + }; |
| + |
| + // Observer should outlive this. |
| + ExtensionActionIconFactory(const extensions::Extension* extension, |
| + Observer* observer); |
| + virtual ~ExtensionActionIconFactory(); |
| + |
| + // ExtensionAction::IconWrapperFactory override. |
| + virtual gfx::ImageSkia GetIcon(const ExtensionIconSet* icon_set, |
| + ExtensionAction::Type) OVERRIDE; |
| + |
| + private: |
| + const extensions::Extension* extension_; |
| + Observer* observer_; |
| + const ExtensionIconSet* last_icon_set_; |
| + scoped_ptr<ExtensionActionIcon> icon_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ExtensionActionIconFactory); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_ICON_FACTORY_H_ |