Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_PRERENDER_EXTERNAL_PRERENDER_HANDLER_ANDROID_H_ | |
| 6 #define CHROME_BROWSER_PRERENDER_EXTERNAL_PRERENDER_HANDLER_ANDROID_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 | |
| 10 #include "base/android/scoped_java_ref.h" | |
| 11 #include "base/memory/ref_counted.h" | |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 | |
| 14 class GURL; | |
| 15 class Profile; | |
| 16 | |
| 17 namespace content { | |
| 18 class WebContents; | |
| 19 } | |
| 20 | |
| 21 namespace prerender { | |
| 22 class PrerenderHandle; | |
| 23 | |
| 24 // A class for handling external prerender requests from other applications. | |
| 25 class ExternalPrerenderHandlerAndroid { | |
| 26 public: | |
| 27 explicit ExternalPrerenderHandlerAndroid(); | |
| 28 | |
| 29 // Add a prerender with the given url and referrer on the PrerenderManager of | |
| 30 // the given profile. The prerender_handle_ will be resetted with the | |
|
cbentzel
2013/11/01 10:45:20
Nit: prerender_handle_ is an internal implementati
Yusuf
2013/11/01 17:04:01
Done.
| |
| 31 // resulting PrerenderHandler. | |
| 32 bool AddPrerender(JNIEnv* env, | |
| 33 jobject obj, | |
|
cbentzel
2013/11/01 10:45:20
Nit: indent by one space to line up with previous
Yusuf
2013/11/01 17:04:01
Done.
| |
| 34 jobject profile, | |
| 35 jint web_content_ptr, | |
| 36 jstring url, | |
| 37 jstring referrer, | |
| 38 jint width, | |
| 39 jint height); | |
| 40 | |
| 41 // Cancel the prerender associated with the prerender_handle_ | |
| 42 void CancelCurrentPrerender(JNIEnv* env, jobject object); | |
| 43 | |
| 44 // Whether the PrerenderManager associated with the given profile has any | |
| 45 // prerenders for the url. | |
| 46 static bool HasPrerenderedUrl(Profile* profile, | |
| 47 GURL url, | |
| 48 content::WebContents* web_contents); | |
| 49 | |
| 50 static bool RegisterExternalPrerenderHandlerAndroid(JNIEnv* env); | |
| 51 | |
| 52 private: | |
| 53 virtual ~ExternalPrerenderHandlerAndroid(); | |
| 54 scoped_ptr<prerender::PrerenderHandle> prerender_handle_; | |
| 55 | |
| 56 DISALLOW_COPY_AND_ASSIGN(ExternalPrerenderHandlerAndroid); | |
| 57 }; | |
| 58 | |
| 59 } // namespace prerender | |
| 60 | |
| 61 #endif // CHROME_BROWSER_PRERENDER_EXTERNAL_PRERENDER_HANDLER_ANDROID_H_ | |
| OLD | NEW |