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

Unified Diff: chrome/browser/search/suggestions/image_manager.h

Issue 392983007: [Suggestions] Make ThumbnailManager implement ImageManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
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..ce63ab7ecd66a06d993c288fd4fb397b5c2dc639
--- /dev/null
+++ b/chrome/browser/search/suggestions/image_manager.h
@@ -0,0 +1,38 @@
+// Copyright 2014 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_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"
huangs 2014/07/17 18:23:35 Note that SuggestionsProfile can be pre-declared (
Mathieu 2014/07/17 18:29:12 Since there's no CC I prefer to have it here
+#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:
+ ImageManager() {}
+ virtual ~ImageManager() {}
+
+ // Initializes the internal data representation with the data received from
huangs 2014/07/17 18:23:35 NIT: // (Re)Initializes states using data received
Mathieu 2014/07/17 18:29:12 Done.
Mathieu 2014/07/17 18:29:12 Done.
+ // the SuggestionsService.
+ virtual void Initialize(const SuggestionsProfile& suggestions) = 0;
+
+ // Retrieves stored image for website |url| asynchronously. Calls |callback|
+ // with Bitmap pointer if found, and NULL otherwise.
+ virtual void GetImageForURL(
+ const GURL& url,
+ base::Callback<void(const GURL&, const SkBitmap*)> callback) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ImageManager);
+};
+
+} // namespace suggestions
+
+#endif // CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698