| OLD | NEW |
| 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_SUGGESTIONS_IMAGE_MANAGER_H_ | 5 #ifndef COMPONENTS_SUGGESTIONS_IMAGE_MANAGER_H_ |
| 6 #define COMPONENTS_SUGGESTIONS_IMAGE_MANAGER_H_ | 6 #define COMPONENTS_SUGGESTIONS_IMAGE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 // Should be called from the UI thread. | 55 // Should be called from the UI thread. |
| 56 virtual void AddImageURL(const GURL& url, const GURL& image_url); | 56 virtual void AddImageURL(const GURL& url, const GURL& image_url); |
| 57 | 57 |
| 58 // Should be called from the UI thread. | 58 // Should be called from the UI thread. |
| 59 virtual void GetImageForURL( | 59 virtual void GetImageForURL( |
| 60 const GURL& url, | 60 const GURL& url, |
| 61 base::Callback<void(const GURL&, const SkBitmap*)> callback); | 61 base::Callback<void(const GURL&, const SkBitmap*)> callback); |
| 62 | 62 |
| 63 protected: | 63 protected: |
| 64 // Methods inherited from image_fetcher::ImageFetcherDelegate |
| 65 |
| 64 // Perform additional tasks when an image has been fetched. | 66 // Perform additional tasks when an image has been fetched. |
| 65 void OnImageFetched(const GURL& url, const SkBitmap* bitmap) override; | 67 void OnImageFetched(const GURL& url, const gfx::Image& image) override; |
| 66 | 68 |
| 67 private: | 69 private: |
| 68 friend class MockImageManager; | 70 friend class MockImageManager; |
| 69 friend class ImageManagerTest; | 71 friend class ImageManagerTest; |
| 70 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, InitializeTest); | 72 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, InitializeTest); |
| 71 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, AddImageURL); | 73 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, AddImageURL); |
| 72 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, GetImageForURLNetworkCacheHit); | 74 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, GetImageForURLNetworkCacheHit); |
| 73 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, | 75 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, |
| 74 GetImageForURLNetworkCacheNotInitialized); | 76 GetImageForURLNetworkCacheNotInitialized); |
| 75 | 77 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 base::ThreadChecker thread_checker_; | 158 base::ThreadChecker thread_checker_; |
| 157 | 159 |
| 158 base::WeakPtrFactory<ImageManager> weak_ptr_factory_; | 160 base::WeakPtrFactory<ImageManager> weak_ptr_factory_; |
| 159 | 161 |
| 160 DISALLOW_COPY_AND_ASSIGN(ImageManager); | 162 DISALLOW_COPY_AND_ASSIGN(ImageManager); |
| 161 }; | 163 }; |
| 162 | 164 |
| 163 } // namespace suggestions | 165 } // namespace suggestions |
| 164 | 166 |
| 165 #endif // COMPONENTS_SUGGESTIONS_IMAGE_MANAGER_H_ | 167 #endif // COMPONENTS_SUGGESTIONS_IMAGE_MANAGER_H_ |
| OLD | NEW |