blob: e0c96a63a0c96a9306cfce25dfb3c3a7f2a9ba2e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
// 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 CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_ANDROID_H_
#define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_ANDROID_H_
#include <jni.h>
#include "base/android/scoped_java_ref.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "content/common/content_export.h"
namespace content {
class NavigationController;
// Android wrapper around NavigationController that provides safer passage
// from java and back to native and provides java with a means of communicating
// with its native counterpart.
class CONTENT_EXPORT NavigationControllerAndroid {
public:
static bool Register(JNIEnv* env);
explicit NavigationControllerAndroid(
NavigationController* navigation_controller);
~NavigationControllerAndroid();
NavigationController* navigation_controller() const {
return navigation_controller_;
}
base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
jboolean CanGoBack(JNIEnv* env, jobject obj);
jboolean CanGoForward(JNIEnv* env, jobject obj);
jboolean CanGoToOffset(JNIEnv* env, jobject obj, jint offset);
void GoBack(JNIEnv* env, jobject obj);
void GoForward(JNIEnv* env, jobject obj);
void GoToOffset(JNIEnv* env, jobject obj, jint offset);
void GoToNavigationIndex(JNIEnv* env, jobject obj, jint index);
private:
NavigationController* navigation_controller_;
base::android::ScopedJavaGlobalRef<jobject> obj_;
DISALLOW_COPY_AND_ASSIGN(NavigationControllerAndroid);
};
} // namespace content
#endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_ANDROID_H_
|