Index: chrome/browser/search/suggestions/image_manager.h |
diff --git a/chrome/browser/search/suggestions/image_manager.h b/chrome/browser/search/suggestions/image_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c5f15ca9d9ab6e4b441647f31977547e6cb6dc21 |
--- /dev/null |
+++ b/chrome/browser/search/suggestions/image_manager.h |
@@ -0,0 +1,35 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
huangs
2014/07/16 22:22:23
Should this file live outside Chrome?
Mathieu
2014/07/17 16:06:35
Yes it will move inside a component soon, next CL.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_MANAGER_H_ |
+#define CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_MANAGER_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/callback.h" |
+#include "chrome/browser/search/suggestions/proto/suggestions.pb.h" |
+#include "ui/gfx/image/image_skia.h" |
+#include "url/gurl.h" |
+ |
+namespace suggestions { |
+ |
+// An interface to retrieve images related to a specific URL. |
+class ImageManager { |
+ public: |
+ virtual ~ImageManager() {} |
+ |
+ // Initializes the internal image map with the proper mapping from website |
+ // URL to image URL. |
+ virtual void InitializeImageMap(const SuggestionsProfile& suggestions) = 0; |
huangs
2014/07/16 22:22:24
Should the concept of "image map" be a generic int
Mathieu
2014/07/17 16:06:35
Discussed offline.
|
+ |
+ // Retrieves stored image for website |url| asynchronously. Calls |
+ // |callback| with Bitmap pointer if found, and NULL otherwise. Should be |
huangs
2014/07/16 22:22:23
NIT: unwrap |callback| to previous line.
Mathieu
2014/07/17 16:06:35
Done.
|
+ // called from the UI thread. |
+ virtual void GetImageForURL( |
huangs
2014/07/16 22:22:24
Would "UI thread" be a Chrome (even browser) conce
Mathieu
2014/07/17 16:06:35
Done.
|
+ const GURL& url, |
+ base::Callback<void(const GURL&, const SkBitmap*)> callback) = 0; |
+}; |
huangs
2014/07/16 22:22:23
DISALLOW_COPY_AND_ASSIGN ?
Mathieu
2014/07/17 16:06:35
Done.
|
+ |
+} // namespace suggestions |
+ |
+#endif // CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_MANAGER_H_ |