Update broken references to image assets
[chromium-blink-merge.git] / chrome / browser / extensions / app_icon_loader.h
blob05e19e5353d9a846177569eb3678dc8919883297
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_APP_ICON_LOADER_H_
6 #define CHROME_BROWSER_EXTENSIONS_APP_ICON_LOADER_H_
8 #include <string>
10 #include "base/basictypes.h"
12 namespace gfx {
13 class ImageSkia;
16 namespace extensions {
18 // Interface used to load app icons. This is in its own class so that it can
19 // be mocked.
20 class AppIconLoader {
21 public:
22 class Delegate {
23 public:
24 virtual ~Delegate() {}
26 // Called when the image for an app is loaded.
27 virtual void SetAppImage(const std::string& id,
28 const gfx::ImageSkia& image) = 0;
31 AppIconLoader() {}
32 virtual ~AppIconLoader() {}
34 // Fetches the image for the specified id. When done (which may be
35 // synchronous), this should invoke SetAppImage() on the delegate.
36 virtual void FetchImage(const std::string& id) = 0;
38 // Clears the image for the specified id.
39 virtual void ClearImage(const std::string& id) = 0;
41 // Updates the image for the specified id. This is called to re-create
42 // the app icon with latest app state (enabled or disabled/terminiated).
43 // SetAppImage() is called when done.
44 virtual void UpdateImage(const std::string& id) = 0;
46 private:
47 DISALLOW_COPY_AND_ASSIGN(AppIconLoader);
50 } // namespace extensions
52 #endif // CHROME_BROWSER_EXTENSIONS_APP_ICON_LOADER_H_