| 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 "base/android/jni_weak_ref.h" |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 12 | 13 |
| 13 class LogoService; | 14 class LogoService; |
| 14 | 15 |
| 15 // The C++ counterpart to LogoBridge.java. Enables Java code to access the | 16 // The C++ counterpart to LogoBridge.java. Enables Java code to access the |
| 16 // default search provider's logo. | 17 // default search provider's logo. |
| 17 class LogoBridge { | 18 class LogoBridge { |
| 18 public: | 19 public: |
| 19 explicit LogoBridge(jobject j_profile); | 20 explicit LogoBridge(jobject j_profile); |
| 20 void Destroy(JNIEnv* env, jobject obj); | 21 void Destroy(JNIEnv* env, jobject obj); |
| 21 void GetCurrentLogo(JNIEnv* env, jobject obj, jobject j_logo_observer); | 22 void GetCurrentLogo(JNIEnv* env, jobject obj, jobject j_logo_observer); |
| 22 | 23 |
| 24 void GetAnimatedLogo(JNIEnv* env, |
| 25 jobject obj, |
| 26 jobject j_listener, |
| 27 jstring j_url); |
| 28 |
| 29 void OnAnimatedLogoReady(const std::string& raw_string); |
| 30 |
| 31 LogoService* logo_service_; |
| 32 |
| 23 private: | 33 private: |
| 24 ~LogoBridge(); | 34 ~LogoBridge(); |
| 25 | 35 |
| 26 LogoService* logo_service_; | 36 JavaObjectWeakGlobalRef j_listener_weak_ref; |
| 37 |
| 27 base::WeakPtrFactory<LogoBridge> weak_ptr_factory_; | 38 base::WeakPtrFactory<LogoBridge> weak_ptr_factory_; |
| 28 | 39 |
| 29 DISALLOW_COPY_AND_ASSIGN(LogoBridge); | 40 DISALLOW_COPY_AND_ASSIGN(LogoBridge); |
| 30 }; | 41 }; |
| 31 | 42 |
| 32 bool RegisterLogoBridge(JNIEnv* env); | 43 bool RegisterLogoBridge(JNIEnv* env); |
| 33 | 44 |
| 34 #endif // CHROME_BROWSER_ANDROID_LOGO_BRIDGE_H_ | 45 #endif // CHROME_BROWSER_ANDROID_LOGO_BRIDGE_H_ |
| OLD | NEW |