Move about://-related constants from //content to //url
[chromium-blink-merge.git] / content / browser / frame_host / navigation_controller_android.h
blobe0c96a63a0c96a9306cfce25dfb3c3a7f2a9ba2e
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.
5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_ANDROID_H_
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_ANDROID_H_
8 #include <jni.h>
10 #include "base/android/scoped_java_ref.h"
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "content/common/content_export.h"
15 namespace content {
17 class NavigationController;
19 // Android wrapper around NavigationController that provides safer passage
20 // from java and back to native and provides java with a means of communicating
21 // with its native counterpart.
22 class CONTENT_EXPORT NavigationControllerAndroid {
23 public:
24 static bool Register(JNIEnv* env);
26 explicit NavigationControllerAndroid(
27 NavigationController* navigation_controller);
28 ~NavigationControllerAndroid();
30 NavigationController* navigation_controller() const {
31 return navigation_controller_;
34 base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
36 jboolean CanGoBack(JNIEnv* env, jobject obj);
37 jboolean CanGoForward(JNIEnv* env, jobject obj);
38 jboolean CanGoToOffset(JNIEnv* env, jobject obj, jint offset);
39 void GoBack(JNIEnv* env, jobject obj);
40 void GoForward(JNIEnv* env, jobject obj);
41 void GoToOffset(JNIEnv* env, jobject obj, jint offset);
42 void GoToNavigationIndex(JNIEnv* env, jobject obj, jint index);
44 private:
45 NavigationController* navigation_controller_;
46 base::android::ScopedJavaGlobalRef<jobject> obj_;
48 DISALLOW_COPY_AND_ASSIGN(NavigationControllerAndroid);
51 } // namespace content
53 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_ANDROID_H_