Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: chrome/browser/ui/android/navigation_popup.cc

Issue 1308363003: Revert of jni_generator: Make all object-returning natives return ScopedJavaLocalRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/android/navigation_popup.h" 5 #include "chrome/browser/ui/android/navigation_popup.h"
6 6
7 #include "base/android/jni_string.h" 7 #include "base/android/jni_string.h"
8 #include "base/android/scoped_java_ref.h" 8 #include "base/android/scoped_java_ref.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 ScopedJavaLocalRef<jstring> jurl( 73 ScopedJavaLocalRef<jstring> jurl(
74 ConvertUTF8ToJavaString(env, navigation_entry_url.spec())); 74 ConvertUTF8ToJavaString(env, navigation_entry_url.spec()));
75 75
76 Java_NavigationPopup_onFaviconUpdated( 76 Java_NavigationPopup_onFaviconUpdated(
77 env, 77 env,
78 obj.obj(), 78 obj.obj(),
79 jurl.obj(), 79 jurl.obj(),
80 gfx::ConvertToJavaBitmap(image.ToSkBitmap()).obj()); 80 gfx::ConvertToJavaBitmap(image.ToSkBitmap()).obj());
81 } 81 }
82 82
83 static ScopedJavaLocalRef<jstring> GetHistoryUrl(JNIEnv* env, jclass clazz) { 83 static jstring GetHistoryUrl(JNIEnv* env, jclass clazz) {
84 return ConvertUTF8ToJavaString(env, chrome::kChromeUIHistoryURL); 84 return ConvertUTF8ToJavaString(env, chrome::kChromeUIHistoryURL).Release();
85 } 85 }
86 86
87 static jlong Init(JNIEnv* env, jobject obj) { 87 static jlong Init(JNIEnv* env, jobject obj) {
88 NavigationPopup* popup = new NavigationPopup(env, obj); 88 NavigationPopup* popup = new NavigationPopup(env, obj);
89 return reinterpret_cast<intptr_t>(popup); 89 return reinterpret_cast<intptr_t>(popup);
90 } 90 }
91 91
92 // static 92 // static
93 bool NavigationPopup::RegisterNavigationPopup(JNIEnv* env) { 93 bool NavigationPopup::RegisterNavigationPopup(JNIEnv* env) {
94 return RegisterNativesImpl(env); 94 return RegisterNativesImpl(env);
95 } 95 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698