| 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_BANNERS_APP_BANNER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_ | 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_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/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" |
| 11 #include "chrome/browser/android/banners/app_banner_infobar_delegate.h" | 13 #include "chrome/browser/android/banners/app_banner_infobar_delegate.h" |
| 12 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" | 14 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" |
| 13 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
| 14 #include "content/public/common/manifest.h" | 16 #include "content/public/common/manifest.h" |
| 15 | 17 |
| 16 namespace content { | 18 namespace content { |
| 17 struct FrameNavigateParams; | 19 struct FrameNavigateParams; |
| 18 struct LoadCommittedDetails; | 20 struct LoadCommittedDetails; |
| 19 struct Manifest; | 21 struct Manifest; |
| 20 } // namespace content | 22 } // namespace content |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 120 |
| 119 // Called when the renderer has returned information about the meta tag. | 121 // Called when the renderer has returned information about the meta tag. |
| 120 // If there is some metadata for the play store tag, this kicks off the | 122 // If there is some metadata for the play store tag, this kicks off the |
| 121 // process of showing a banner for the package designated by |tag_content| on | 123 // process of showing a banner for the package designated by |tag_content| on |
| 122 // the page at the |expected_url|. | 124 // the page at the |expected_url|. |
| 123 void OnDidRetrieveMetaTagContent(bool success, | 125 void OnDidRetrieveMetaTagContent(bool success, |
| 124 const std::string& tag_name, | 126 const std::string& tag_name, |
| 125 const std::string& tag_content, | 127 const std::string& tag_content, |
| 126 const GURL& expected_url); | 128 const GURL& expected_url); |
| 127 | 129 |
| 130 // Called when the result of the CheckHasServiceWorker query has completed. |
| 131 void OnDidCheckHasServiceWorker(bool has_same); |
| 132 |
| 128 // Fetches the icon for an app. | 133 // Fetches the icon for an app. |
| 129 scoped_ptr<chrome::BitmapFetcher> fetcher_; | 134 scoped_ptr<chrome::BitmapFetcher> fetcher_; |
| 130 GURL validated_url_; | 135 GURL validated_url_; |
| 131 content::Manifest manifest_; | 136 content::Manifest manifest_; |
| 132 scoped_ptr<SkBitmap> app_icon_; | 137 scoped_ptr<SkBitmap> app_icon_; |
| 133 | 138 |
| 134 // AppBannerManager on the Java side. | 139 // AppBannerManager on the Java side. |
| 135 JavaObjectWeakGlobalRef weak_java_banner_view_manager_; | 140 JavaObjectWeakGlobalRef weak_java_banner_view_manager_; |
| 136 | 141 |
| 142 // A weak pointer is used as the lifetime of the ServiceWorkerContext is |
| 143 // longer than the lifetime of this banner manager. The banner manager |
| 144 // might be gone when calls sent to the ServiceWorkerContext are completed. |
| 145 base::WeakPtrFactory<AppBannerManager> weak_factory_; |
| 146 |
| 137 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); | 147 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); |
| 138 }; // class AppBannerManager | 148 }; // class AppBannerManager |
| 139 | 149 |
| 140 // Register native methods | 150 // Register native methods |
| 141 bool RegisterAppBannerManager(JNIEnv* env); | 151 bool RegisterAppBannerManager(JNIEnv* env); |
| 142 | 152 |
| 143 } // namespace banners | 153 } // namespace banners |
| 144 | 154 |
| 145 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_ | 155 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_ |
| OLD | NEW |