Chromium Code Reviews| Index: chrome/browser/android/tab_android.cc |
| diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc |
| index 34dd08784d6b27ae30a133a2379b5dbd59bd0f50..973886cf574bc89d4b903a7307161204ec8c5661 100644 |
| --- a/chrome/browser/android/tab_android.cc |
| +++ b/chrome/browser/android/tab_android.cc |
| @@ -660,6 +660,27 @@ void TabAndroid::SetActiveNavigationEntryTitleForUrl( |
| entry->SetTitle(title); |
| } |
| +void TabAndroid::SetLastCommittedNavigationEntryExtraData( |
| + JNIEnv* env, |
| + const JavaParamRef<jobject>& obj, |
| + const JavaParamRef<jstring>& jkey, |
| + const JavaParamRef<jstring>& jvalue) { |
| + DCHECK(web_contents()); |
| + |
| + std::string key; |
| + if (jkey) |
|
Bernhard Bauer
2016/09/16 15:02:50
I don't think we expect either of these to be null
Michael van Ouwerkerk
2016/09/16 16:35:05
Done.
|
| + key = base::android::ConvertJavaStringToUTF8(env, jkey); |
| + |
| + base::string16 value; |
| + if (jvalue) |
| + value = base::android::ConvertJavaStringToUTF16(env, jvalue); |
| + |
| + content::NavigationEntry* entry = |
| + web_contents()->GetController().GetLastCommittedEntry(); |
| + if (entry) |
| + entry->SetExtraData(key, value); |
| +} |
| + |
| bool TabAndroid::Print(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| if (!web_contents()) |
| return false; |