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 <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 virtual void Initialize(const SuggestionsProfile& suggestions); | 45 virtual void Initialize(const SuggestionsProfile& suggestions); |
46 | 46 |
47 // Should be called from the UI thread. | 47 // Should be called from the UI thread. |
48 virtual void GetImageForURL( | 48 virtual void GetImageForURL( |
49 const GURL& url, | 49 const GURL& url, |
50 base::Callback<void(const GURL&, const SkBitmap*)> callback); | 50 base::Callback<void(const GURL&, const SkBitmap*)> callback); |
51 | 51 |
52 protected: | 52 protected: |
53 // Perform additional tasks when an image has been fetched. | 53 // Perform additional tasks when an image has been fetched. |
54 virtual void OnImageFetched(const GURL& url, const SkBitmap* bitmap) OVERRIDE; | 54 virtual void OnImageFetched(const GURL& url, const SkBitmap* bitmap) override; |
55 | 55 |
56 private: | 56 private: |
57 friend class MockImageManager; | 57 friend class MockImageManager; |
58 friend class ImageManagerTest; | 58 friend class ImageManagerTest; |
59 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, InitializeTest); | 59 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, InitializeTest); |
60 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, GetImageForURLNetworkCacheHit); | 60 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, GetImageForURLNetworkCacheHit); |
61 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, | 61 FRIEND_TEST_ALL_PREFIXES(ImageManagerTest, |
62 GetImageForURLNetworkCacheNotInitialized); | 62 GetImageForURLNetworkCacheNotInitialized); |
63 | 63 |
64 // Used for testing. | 64 // Used for testing. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 base::WeakPtrFactory<ImageManager> weak_ptr_factory_; | 144 base::WeakPtrFactory<ImageManager> weak_ptr_factory_; |
145 | 145 |
146 base::ThreadChecker thread_checker_; | 146 base::ThreadChecker thread_checker_; |
147 | 147 |
148 DISALLOW_COPY_AND_ASSIGN(ImageManager); | 148 DISALLOW_COPY_AND_ASSIGN(ImageManager); |
149 }; | 149 }; |
150 | 150 |
151 } // namespace suggestions | 151 } // namespace suggestions |
152 | 152 |
153 #endif // COMPONENTS_SUGGESTIONS_IMAGE_MANAGER_H_ | 153 #endif // COMPONENTS_SUGGESTIONS_IMAGE_MANAGER_H_ |
OLD | NEW |