| 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/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/time/time.h" |
| 13 #include "chrome/browser/android/banners/app_banner_infobar_delegate.h" | 14 #include "chrome/browser/android/banners/app_banner_infobar_delegate.h" |
| 14 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" | 15 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" |
| 15 #include "chrome/browser/ui/android/infobars/app_banner_infobar.h" | 16 #include "chrome/browser/ui/android/infobars/app_banner_infobar.h" |
| 16 #include "components/infobars/core/infobar_manager.h" | 17 #include "components/infobars/core/infobar_manager.h" |
| 17 #include "content/public/browser/web_contents_observer.h" | 18 #include "content/public/browser/web_contents_observer.h" |
| 18 #include "content/public/common/manifest.h" | 19 #include "content/public/common/manifest.h" |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 struct FrameNavigateParams; | 22 struct FrameNavigateParams; |
| 22 struct LoadCommittedDetails; | 23 struct LoadCommittedDetails; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 jobject obj, | 87 jobject obj, |
| 87 jobject japp_data, | 88 jobject japp_data, |
| 88 jstring japp_title, | 89 jstring japp_title, |
| 89 jstring japp_package, | 90 jstring japp_package, |
| 90 jstring jicon_url); | 91 jstring jicon_url); |
| 91 | 92 |
| 92 // Fetches the icon at the given URL asynchronously. | 93 // Fetches the icon at the given URL asynchronously. |
| 93 // Returns |false| if this couldn't be kicked off. | 94 // Returns |false| if this couldn't be kicked off. |
| 94 bool FetchIcon(const GURL& image_url); | 95 bool FetchIcon(const GURL& image_url); |
| 95 | 96 |
| 97 // Return how many fetchers are active. |
| 98 int GetNumActiveFetchers(JNIEnv* env, jobject jobj); |
| 99 |
| 100 // Returns the current time. |
| 101 static base::Time GetCurrentTime(); |
| 102 |
| 96 // WebContentsObserver overrides. | 103 // WebContentsObserver overrides. |
| 97 void DidNavigateMainFrame( | 104 void DidNavigateMainFrame( |
| 98 const content::LoadCommittedDetails& details, | 105 const content::LoadCommittedDetails& details, |
| 99 const content::FrameNavigateParams& params) override; | 106 const content::FrameNavigateParams& params) override; |
| 100 void DidFinishLoad(content::RenderFrameHost* render_frame_host, | 107 void DidFinishLoad(content::RenderFrameHost* render_frame_host, |
| 101 const GURL& validated_url) override; | 108 const GURL& validated_url) override; |
| 102 bool OnMessageReceived(const IPC::Message& message) override; | 109 bool OnMessageReceived(const IPC::Message& message) override; |
| 103 | 110 |
| 104 // BitmapFetcherDelegate overrides. | 111 // BitmapFetcherDelegate overrides. |
| 105 void OnFetchComplete(const GURL url, const SkBitmap* bitmap) override; | 112 void OnFetchComplete(const GURL url, const SkBitmap* bitmap) override; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 160 |
| 154 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); | 161 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); |
| 155 }; // class AppBannerManager | 162 }; // class AppBannerManager |
| 156 | 163 |
| 157 // Register native methods | 164 // Register native methods |
| 158 bool RegisterAppBannerManager(JNIEnv* env); | 165 bool RegisterAppBannerManager(JNIEnv* env); |
| 159 | 166 |
| 160 } // namespace banners | 167 } // namespace banners |
| 161 | 168 |
| 162 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_ | 169 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_H_ |
| OLD | NEW |