| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/android/sessions/session_tab_helper_android.h" | 5 #include "chrome/browser/android/sessions/session_tab_helper_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "chrome/browser/sessions/session_tab_helper.h" | 8 #include "chrome/browser/sessions/session_tab_helper.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "jni/SessionTabHelper_jni.h" | 10 #include "jni/SessionTabHelper_jni.h" |
| 11 | 11 |
| 12 using base::android::JavaParamRef; |
| 13 |
| 12 // static | 14 // static |
| 13 jint IdForTab(JNIEnv* env, | 15 jint IdForTab(JNIEnv* env, |
| 14 const JavaParamRef<jclass>& clazz, | 16 const JavaParamRef<jclass>& clazz, |
| 15 const JavaParamRef<jobject>& java_web_contents) { | 17 const JavaParamRef<jobject>& java_web_contents) { |
| 16 content::WebContents* web_contents = | 18 content::WebContents* web_contents = |
| 17 content::WebContents::FromJavaWebContents(java_web_contents); | 19 content::WebContents::FromJavaWebContents(java_web_contents); |
| 18 CHECK(web_contents); | 20 CHECK(web_contents); |
| 19 return SessionTabHelper::IdForTab(web_contents); | 21 return SessionTabHelper::IdForTab(web_contents); |
| 20 } | 22 } |
| 21 | 23 |
| 22 bool RegisterSessionTabHelper(JNIEnv* env) { | 24 bool RegisterSessionTabHelper(JNIEnv* env) { |
| 23 return RegisterNativesImpl(env); | 25 return RegisterNativesImpl(env); |
| 24 } | 26 } |
| OLD | NEW |