Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / content / browser / web_contents / web_contents_android.h
blobeec6127220a2a616e59e39c13c302d2d259e1809
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_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_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 "base/supports_user_data.h"
14 #include "content/browser/frame_host/navigation_controller_android.h"
15 #include "content/common/content_export.h"
17 namespace content {
19 class WebContents;
21 // Android wrapper around WebContents that provides safer passage from java and
22 // back to native and provides java with a means of communicating with its
23 // native counterpart.
24 class CONTENT_EXPORT WebContentsAndroid
25 : public base::SupportsUserData::Data {
26 public:
27 static bool Register(JNIEnv* env);
29 explicit WebContentsAndroid(WebContents* web_contents);
30 virtual ~WebContentsAndroid();
32 WebContents* web_contents() const { return web_contents_; }
34 base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
36 // Methods called from Java
37 base::android::ScopedJavaLocalRef<jstring> GetTitle(JNIEnv* env,
38 jobject obj) const;
39 void Stop(JNIEnv* env, jobject obj);
41 private:
42 WebContents* web_contents_;
43 NavigationControllerAndroid navigation_controller_;
44 base::android::ScopedJavaGlobalRef<jobject> obj_;
46 DISALLOW_COPY_AND_ASSIGN(WebContentsAndroid);
49 } // namespace content
51 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_