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

Side by Side Diff: chrome/browser/android/content_view_util.cc

Issue 67573003: Android: moves chrome/ to use long for JNI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
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/android/content_view_util.h" 5 #include "chrome/browser/android/content_view_util.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/profiles/profile_manager.h" 10 #include "chrome/browser/profiles/profile_manager.h"
11 #include "content/public/browser/web_contents.h" 11 #include "content/public/browser/web_contents.h"
12 #include "jni/ContentViewUtil_jni.h" 12 #include "jni/ContentViewUtil_jni.h"
13 13
14 static jint CreateNativeWebContents( 14 static jlong CreateNativeWebContents(
15 JNIEnv* env, jclass clazz, jboolean incognito) { 15 JNIEnv* env, jclass clazz, jboolean incognito) {
16 Profile* profile = g_browser_process->profile_manager()->GetLastUsedProfile(); 16 Profile* profile = g_browser_process->profile_manager()->GetLastUsedProfile();
17 if (incognito) 17 if (incognito)
18 profile = profile->GetOffTheRecordProfile(); 18 profile = profile->GetOffTheRecordProfile();
19 19
20 content::WebContents* web_contents = 20 content::WebContents* web_contents =
21 content::WebContents::Create(content::WebContents::CreateParams(profile)); 21 content::WebContents::Create(content::WebContents::CreateParams(profile));
22 return reinterpret_cast<jint>(web_contents); 22 return reinterpret_cast<intptr_t>(web_contents);
23 } 23 }
24 24
25 static void DestroyNativeWebContents( 25 static void DestroyNativeWebContents(
26 JNIEnv* env, jclass clazz, jint web_contents_ptr) { 26 JNIEnv* env, jclass clazz, jlong web_contents_ptr) {
27 content::WebContents* web_contents = 27 content::WebContents* web_contents =
28 reinterpret_cast<content::WebContents*>(web_contents_ptr); 28 reinterpret_cast<content::WebContents*>(web_contents_ptr);
29 delete web_contents; 29 delete web_contents;
30 } 30 }
31 31
32 bool RegisterContentViewUtil(JNIEnv* env) { 32 bool RegisterContentViewUtil(JNIEnv* env) {
33 return RegisterNativesImpl(env); 33 return RegisterNativesImpl(env);
34 } 34 }
OLDNEW
« no previous file with comments | « chrome/browser/android/chrome_web_contents_delegate_android.cc ('k') | chrome/browser/android/favicon_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698