| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PRERENDER_EXTERNAL_PRERENDER_HANDLER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_EXTERNAL_PRERENDER_HANDLER_ANDROID_H_ |
| 6 #define CHROME_BROWSER_PRERENDER_EXTERNAL_PRERENDER_HANDLER_ANDROID_H_ | 6 #define CHROME_BROWSER_PRERENDER_EXTERNAL_PRERENDER_HANDLER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 namespace prerender { | 22 namespace prerender { |
| 23 class PrerenderHandle; | 23 class PrerenderHandle; |
| 24 | 24 |
| 25 // A class for handling external prerender requests from other applications. | 25 // A class for handling external prerender requests from other applications. |
| 26 class ExternalPrerenderHandlerAndroid { | 26 class ExternalPrerenderHandlerAndroid { |
| 27 public: | 27 public: |
| 28 ExternalPrerenderHandlerAndroid(); | 28 ExternalPrerenderHandlerAndroid(); |
| 29 | 29 |
| 30 // Add a prerender with the given url and referrer on the PrerenderManager of | 30 // Add a prerender with the given url and referrer on the PrerenderManager of |
| 31 // the given profile. This is restricted to a single prerender at a time. | 31 // the given profile. This is restricted to a single prerender at a time. |
| 32 base::android::ScopedJavaLocalRef<jobject> AddPrerender(JNIEnv* env, | 32 base::android::ScopedJavaLocalRef<jobject> AddPrerender( |
| 33 const base::android::JavaParamRef<jobject>& obj, | 33 JNIEnv* env, |
| 34 const base::android::JavaParamRef<jobject>& profile, | 34 const base::android::JavaParamRef<jobject>& obj, |
| 35 const base::android::JavaParamRef<jobject>& jweb_contents, | 35 const base::android::JavaParamRef<jobject>& profile, |
| 36 const base::android::JavaParamRef<jstring>& url, | 36 const base::android::JavaParamRef<jobject>& jweb_contents, |
| 37 const base::android::JavaParamRef<jstring>& referrer, | 37 const base::android::JavaParamRef<jstring>& url, |
| 38 jint top, | 38 const base::android::JavaParamRef<jstring>& referrer, |
| 39 jint left, | 39 jint top, |
| 40 jint bottom, | 40 jint left, |
| 41 jint right, | 41 jint bottom, |
| 42 jboolean prerender_on_cellular); | 42 jint right, |
| 43 jboolean forced_prerender); |
| 43 | 44 |
| 44 // Cancel the prerender associated with the prerender_handle_ | 45 // Cancel the prerender associated with the prerender_handle_ |
| 45 void CancelCurrentPrerender( | 46 void CancelCurrentPrerender( |
| 46 JNIEnv* env, | 47 JNIEnv* env, |
| 47 const base::android::JavaParamRef<jobject>& object); | 48 const base::android::JavaParamRef<jobject>& object); |
| 48 | 49 |
| 49 // Whether the PrerenderManager associated with the given profile has any | 50 // Whether the PrerenderManager associated with the given profile has any |
| 50 // prerenders for the url. | 51 // prerenders for the url. |
| 51 static bool HasPrerenderedUrl(Profile* profile, | 52 static bool HasPrerenderedUrl(Profile* profile, |
| 52 GURL url, | 53 GURL url, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 64 private: | 65 private: |
| 65 virtual ~ExternalPrerenderHandlerAndroid(); | 66 virtual ~ExternalPrerenderHandlerAndroid(); |
| 66 std::unique_ptr<prerender::PrerenderHandle> prerender_handle_; | 67 std::unique_ptr<prerender::PrerenderHandle> prerender_handle_; |
| 67 | 68 |
| 68 DISALLOW_COPY_AND_ASSIGN(ExternalPrerenderHandlerAndroid); | 69 DISALLOW_COPY_AND_ASSIGN(ExternalPrerenderHandlerAndroid); |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 } // namespace prerender | 72 } // namespace prerender |
| 72 | 73 |
| 73 #endif // CHROME_BROWSER_PRERENDER_EXTERNAL_PRERENDER_HANDLER_ANDROID_H_ | 74 #endif // CHROME_BROWSER_PRERENDER_EXTERNAL_PRERENDER_HANDLER_ANDROID_H_ |
| OLD | NEW |