| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ |
| 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ | 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_weak_ref.h" | 9 #include "base/android/jni_weak_ref.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // Called when the Java-side has retrieved information for the app. | 45 // Called when the Java-side has retrieved information for the app. |
| 46 // Returns |false| if an icon fetch couldn't be kicked off. | 46 // Returns |false| if an icon fetch couldn't be kicked off. |
| 47 bool OnAppDetailsRetrieved( | 47 bool OnAppDetailsRetrieved( |
| 48 JNIEnv* env, | 48 JNIEnv* env, |
| 49 const base::android::JavaParamRef<jobject>& obj, | 49 const base::android::JavaParamRef<jobject>& obj, |
| 50 const base::android::JavaParamRef<jobject>& japp_data, | 50 const base::android::JavaParamRef<jobject>& japp_data, |
| 51 const base::android::JavaParamRef<jstring>& japp_title, | 51 const base::android::JavaParamRef<jstring>& japp_title, |
| 52 const base::android::JavaParamRef<jstring>& japp_package, | 52 const base::android::JavaParamRef<jstring>& japp_package, |
| 53 const base::android::JavaParamRef<jstring>& jicon_url); | 53 const base::android::JavaParamRef<jstring>& jicon_url); |
| 54 | 54 |
| 55 // Requests the app banner. This method is called from the DevTools. |
| 56 void RequestAppBanner(JNIEnv* env, |
| 57 const base::android::JavaParamRef<jobject>& jobj); |
| 58 |
| 55 protected: | 59 protected: |
| 56 AppBannerDataFetcher* CreateAppBannerDataFetcher( | 60 AppBannerDataFetcher* CreateAppBannerDataFetcher( |
| 57 base::WeakPtr<AppBannerDataFetcher::Delegate> weak_delegate) override; | 61 base::WeakPtr<AppBannerDataFetcher::Delegate> weak_delegate, |
| 62 bool is_debug_mode) override; |
| 58 | 63 |
| 59 private: | 64 private: |
| 60 // AppBannerDataFetcher::Delegate overrides. | 65 // AppBannerDataFetcher::Delegate overrides. |
| 61 bool HandleNonWebApp(const std::string& platform, | 66 bool HandleNonWebApp(const std::string& platform, |
| 62 const GURL& url, | 67 const GURL& url, |
| 63 const std::string& id) override; | 68 const std::string& id, |
| 69 bool is_debug_mode) override; |
| 64 | 70 |
| 65 bool CheckPlatformAndId(const std::string& platform, const std::string& id); | 71 bool CheckPlatformAndId(const std::string& platform, |
| 72 const std::string& id, |
| 73 bool is_debug_mode); |
| 66 | 74 |
| 67 bool CheckFetcherMatchesContents(); | 75 bool CheckFetcherMatchesContents(bool is_debug_mode); |
| 68 | 76 |
| 69 std::string ExtractQueryValueForName(const GURL& url, | 77 std::string ExtractQueryValueForName(const GURL& url, |
| 70 const std::string& name); | 78 const std::string& name); |
| 71 | 79 |
| 72 // AppBannerManager on the Java side. | 80 // AppBannerManager on the Java side. |
| 73 JavaObjectWeakGlobalRef weak_java_banner_view_manager_; | 81 JavaObjectWeakGlobalRef weak_java_banner_view_manager_; |
| 74 | 82 |
| 75 DISALLOW_COPY_AND_ASSIGN(AppBannerManagerAndroid); | 83 DISALLOW_COPY_AND_ASSIGN(AppBannerManagerAndroid); |
| 76 }; // class AppBannerManagerAndroid | 84 }; // class AppBannerManagerAndroid |
| 77 | 85 |
| 78 } // namespace banners | 86 } // namespace banners |
| 79 | 87 |
| 80 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ | 88 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ |
| OLD | NEW |