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 CHROME_BROWSER_ANDROID_LOGO_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_LOGO_BRIDGE_H_ |
6 #define CHROME_BROWSER_ANDROID_LOGO_BRIDGE_H_ | 6 #define CHROME_BROWSER_ANDROID_LOGO_BRIDGE_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 25 matching lines...) Expand all Loading... |
36 class LogoBridge : public doodle::DoodleService::Observer { | 36 class LogoBridge : public doodle::DoodleService::Observer { |
37 public: | 37 public: |
38 explicit LogoBridge(jobject j_profile); | 38 explicit LogoBridge(jobject j_profile); |
39 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 39 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
40 | 40 |
41 // Gets the current non-animated logo (downloading it if necessary) and passes | 41 // Gets the current non-animated logo (downloading it if necessary) and passes |
42 // it to the observer. | 42 // it to the observer. |
43 void GetCurrentLogo( | 43 void GetCurrentLogo( |
44 JNIEnv* env, | 44 JNIEnv* env, |
45 const base::android::JavaParamRef<jobject>& obj, | 45 const base::android::JavaParamRef<jobject>& obj, |
46 const base::android::JavaParamRef<jobject>& j_logo_observer); | 46 const base::android::JavaParamRef<jobject>& j_logo_observer, |
| 47 const base::android::JavaParamRef<jobject>& j_refresh_skipped_callback); |
47 | 48 |
48 // Downloads the animated logo from the given URL and returns it to the | 49 // Downloads the animated logo from the given URL and returns it to the |
49 // callback. Does not support multiple concurrent requests: A second request | 50 // callback. Does not support multiple concurrent requests: A second request |
50 // for the same URL will be ignored; a request for a different URL will cancel | 51 // for the same URL will be ignored; a request for a different URL will cancel |
51 // any ongoing request. If downloading fails, the callback is not called. | 52 // any ongoing request. If downloading fails, the callback is not called. |
52 void GetAnimatedLogo(JNIEnv* env, | 53 void GetAnimatedLogo(JNIEnv* env, |
53 const base::android::JavaParamRef<jobject>& obj, | 54 const base::android::JavaParamRef<jobject>& obj, |
54 const base::android::JavaParamRef<jobject>& j_callback, | 55 const base::android::JavaParamRef<jobject>& j_callback, |
55 const base::android::JavaParamRef<jstring>& j_url); | 56 const base::android::JavaParamRef<jstring>& j_url); |
56 | 57 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 std::unique_ptr<AnimatedLogoFetcher> animated_logo_fetcher_; | 89 std::unique_ptr<AnimatedLogoFetcher> animated_logo_fetcher_; |
89 | 90 |
90 base::WeakPtrFactory<LogoBridge> weak_ptr_factory_; | 91 base::WeakPtrFactory<LogoBridge> weak_ptr_factory_; |
91 | 92 |
92 DISALLOW_COPY_AND_ASSIGN(LogoBridge); | 93 DISALLOW_COPY_AND_ASSIGN(LogoBridge); |
93 }; | 94 }; |
94 | 95 |
95 bool RegisterLogoBridge(JNIEnv* env); | 96 bool RegisterLogoBridge(JNIEnv* env); |
96 | 97 |
97 #endif // CHROME_BROWSER_ANDROID_LOGO_BRIDGE_H_ | 98 #endif // CHROME_BROWSER_ANDROID_LOGO_BRIDGE_H_ |
OLD | NEW |