OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_BROWSER_ANDROID_DOWNLOAD_UI_THUMBNAIL_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_UI_THUMBNAIL_PROVIDER_H_ |
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_UI_THUMBNAIL_PROVIDER_H_ | 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_UI_THUMBNAIL_PROVIDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| 11 #include "base/memory/weak_ptr.h" |
11 #include "chrome/browser/image_decoder.h" | 12 #include "chrome/browser/image_decoder.h" |
12 | 13 |
13 // Kicks off asynchronous pipelines for creating thumbnails for local files. | 14 // Kicks off asynchronous pipelines for creating thumbnails for local files. |
14 // The native-side ThumbnailProvider is owned by the Java-side and can be | 15 // The native-side ThumbnailProvider is owned by the Java-side and can be |
15 // safely destroyed while a request is being processed. | 16 // safely destroyed while a request is being processed. |
16 class ThumbnailProvider { | 17 class ThumbnailProvider { |
17 public: | 18 public: |
18 explicit ThumbnailProvider(const base::android::JavaParamRef<jobject>& jobj); | 19 explicit ThumbnailProvider(const base::android::JavaParamRef<jobject>& jobj); |
19 | 20 |
20 // Destroys the ThumbnailProvider. Any currently running ImageRequest will | 21 // Destroys the ThumbnailProvider. Any currently running ImageRequest will |
(...skipping 17 matching lines...) Expand all Loading... |
38 private: | 39 private: |
39 ~ThumbnailProvider(); | 40 ~ThumbnailProvider(); |
40 | 41 |
41 base::android::ScopedJavaGlobalRef<jobject> java_delegate_; | 42 base::android::ScopedJavaGlobalRef<jobject> java_delegate_; |
42 base::WeakPtrFactory<ThumbnailProvider> weak_factory_; | 43 base::WeakPtrFactory<ThumbnailProvider> weak_factory_; |
43 | 44 |
44 DISALLOW_COPY_AND_ASSIGN(ThumbnailProvider); | 45 DISALLOW_COPY_AND_ASSIGN(ThumbnailProvider); |
45 }; | 46 }; |
46 | 47 |
47 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_UI_THUMBNAIL_PROVIDER_H_ | 48 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_UI_THUMBNAIL_PROVIDER_H_ |
OLD | NEW |