Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Unified Diff: chrome/browser/prerender/external_prerender_handler_android.h

Issue 45693002: Add ExternalPrerenderRequestHandler and related API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed the files Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/prerender/external_prerender_handler_android.h
diff --git a/chrome/browser/prerender/external_prerender_handler_android.h b/chrome/browser/prerender/external_prerender_handler_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..cfa63529ff1a98a77a3039804afcd281fe85e012
--- /dev/null
+++ b/chrome/browser/prerender/external_prerender_handler_android.h
@@ -0,0 +1,61 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PRERENDER_EXTERNAL_PRERENDER_HANDLER_ANDROID_H_
+#define CHROME_BROWSER_PRERENDER_EXTERNAL_PRERENDER_HANDLER_ANDROID_H_
+
+#include <jni.h>
+
+#include "base/android/scoped_java_ref.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+
+class GURL;
+class Profile;
+
+namespace content {
+class WebContents;
+}
+
+namespace prerender {
+class PrerenderHandle;
+
+// A class for handling external prerender requests from other applications.
+class ExternalPrerenderHandlerAndroid {
+ public:
+ explicit ExternalPrerenderHandlerAndroid();
+
+ // Add a prerender with the given url and referrer on the PrerenderManager of
+ // 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.
+ // resulting PrerenderHandler.
+ bool AddPrerender(JNIEnv* env,
+ 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.
+ jobject profile,
+ jint web_content_ptr,
+ jstring url,
+ jstring referrer,
+ jint width,
+ jint height);
+
+ // Cancel the prerender associated with the prerender_handle_
+ void CancelCurrentPrerender(JNIEnv* env, jobject object);
+
+ // Whether the PrerenderManager associated with the given profile has any
+ // prerenders for the url.
+ static bool HasPrerenderedUrl(Profile* profile,
+ GURL url,
+ content::WebContents* web_contents);
+
+ static bool RegisterExternalPrerenderHandlerAndroid(JNIEnv* env);
+
+ private:
+ virtual ~ExternalPrerenderHandlerAndroid();
+ scoped_ptr<prerender::PrerenderHandle> prerender_handle_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExternalPrerenderHandlerAndroid);
+};
+
+} // namespace prerender
+
+#endif // CHROME_BROWSER_PRERENDER_EXTERNAL_PRERENDER_HANDLER_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698