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

Side by Side 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: Fixed testCancelPrerender to use private Runnable Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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"
Yaron 2013/11/05 01:17:54 unused
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. This is restricted to a single prerender at a time.
31 bool AddPrerender(JNIEnv* env,
32 jobject obj,
33 jobject profile,
34 jint web_content_ptr,
35 jstring url,
36 jstring referrer,
37 jint width,
38 jint height);
39
40 // Cancel the prerender associated with the prerender_handle_
41 void CancelCurrentPrerender(JNIEnv* env, jobject object);
42
43 // Whether the PrerenderManager associated with the given profile has any
44 // prerenders for the url.
45 static bool HasPrerenderedUrl(Profile* profile,
46 GURL url,
47 content::WebContents* web_contents);
48
49 static bool RegisterExternalPrerenderHandlerAndroid(JNIEnv* env);
50
51 private:
52 virtual ~ExternalPrerenderHandlerAndroid();
53 scoped_ptr<prerender::PrerenderHandle> prerender_handle_;
54
55 DISALLOW_COPY_AND_ASSIGN(ExternalPrerenderHandlerAndroid);
56 };
57
58 } // namespace prerender
59
60 #endif // CHROME_BROWSER_PRERENDER_EXTERNAL_PRERENDER_HANDLER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698