Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(405)

Side by Side Diff: components/image_fetcher/image_fetcher_delegate.h

Issue 2047713002: [NTP Snippets] Cache images in a LevelDB (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@protodb_get
Patch Set: add TODOs Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_IMAGE_FETCHER_IMAGE_FETCHER_DELEGATE_H_ 5 #ifndef COMPONENTS_IMAGE_FETCHER_IMAGE_FETCHER_DELEGATE_H_
6 #define COMPONENTS_IMAGE_FETCHER_IMAGE_FETCHER_DELEGATE_H_ 6 #define COMPONENTS_IMAGE_FETCHER_IMAGE_FETCHER_DELEGATE_H_
7 7
8 #include <string>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 11
10 class GURL;
11
12 namespace gfx { 12 namespace gfx {
13 class Image; 13 class Image;
14 } 14 }
15 15
16 namespace image_fetcher { 16 namespace image_fetcher {
17 17
18 class ImageFetcherDelegate { 18 class ImageFetcherDelegate {
19 public: 19 public:
20 ImageFetcherDelegate() {} 20 ImageFetcherDelegate() {}
21 21
22 // Called when an image was fetched. |id| is an identifier for the fetch (as 22 // Called when the data for an image was fetched. |id| is an identifier for
23 // passed to ImageFetcher::StartOrQueueNetworkRequest); |image| stores image 23 // the fetch (as passed to ImageFetcher::StartOrQueueNetworkRequest); |data|
24 // data owned by the caller, and can be an empty gfx::Image. 24 // stores (generally compressed) image data owned by the caller, and can be
25 // empty if the fetch failed.
26 virtual void OnImageDataFetched(const std::string& id,
27 const std::string& data) {};
28
29 // Called when an image was fetched and decoded. |id| is an identifier for the
30 // fetch (as passed to ImageFetcher::StartOrQueueNetworkRequest); |image|
31 // stores image data owned by the caller, and can be an empty gfx::Image.
25 virtual void OnImageFetched(const std::string& id, 32 virtual void OnImageFetched(const std::string& id,
26 const gfx::Image& image) = 0; 33 const gfx::Image& image) {};
27 34
28 protected: 35 protected:
29 virtual ~ImageFetcherDelegate() {} 36 virtual ~ImageFetcherDelegate() {}
30 37
31 DISALLOW_COPY_AND_ASSIGN(ImageFetcherDelegate); 38 DISALLOW_COPY_AND_ASSIGN(ImageFetcherDelegate);
32 }; 39 };
33 40
34 } // namespace image_fetcher 41 } // namespace image_fetcher
35 42
36 #endif // COMPONENTS_IMAGE_FETCHER_IMAGE_FETCHER_DELEGATE_H_ 43 #endif // COMPONENTS_IMAGE_FETCHER_IMAGE_FETCHER_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/search/suggestions/image_fetcher_impl.cc ('k') | components/ntp_snippets/ntp_snippets_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698