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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/TabBase.java

Issue 11098008: Adding a WindowAndroidHelper class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | 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 package org.chromium.chrome.browser; 5 package org.chromium.chrome.browser;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.text.TextUtils; 8 import android.text.TextUtils;
9 9
10 import org.chromium.chrome.browser.ChromeWebContentsDelegateAndroid; 10 import org.chromium.chrome.browser.ChromeWebContentsDelegateAndroid;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 public TabBase(Context context, int nativeWebContentsPtr, 49 public TabBase(Context context, int nativeWebContentsPtr,
50 NativeWindow window, ChromeWebContentsDelegateAndroid delegate) { 50 NativeWindow window, ChromeWebContentsDelegateAndroid delegate) {
51 mWindow = window; 51 mWindow = window;
52 52
53 // Build the WebContents and the ContentView/ContentViewCore 53 // Build the WebContents and the ContentView/ContentViewCore
54 if (nativeWebContentsPtr == 0) { 54 if (nativeWebContentsPtr == 0) {
55 nativeWebContentsPtr = ContentViewUtil.createNativeWebContents(false ); 55 nativeWebContentsPtr = ContentViewUtil.createNativeWebContents(false );
56 } 56 }
57 mContentView = ContentView.newInstance(context, nativeWebContentsPtr, mW indow, 57 mContentView = ContentView.newInstance(context, nativeWebContentsPtr, mW indow,
58 ContentView.PERSONALITY_CHROME); 58 ContentView.PERSONALITY_CHROME);
59 mNativeTabBaseAndroidImpl = nativeInit(nativeWebContentsPtr); 59 mNativeTabBaseAndroidImpl = nativeInit(nativeWebContentsPtr, window.getN ativePointer());
60 60
61 // Build the WebContentsDelegate 61 // Build the WebContentsDelegate
62 mWebContentsDelegate = delegate == null ? new ChromeWebContentsDelegateA ndroid() : delegate; 62 mWebContentsDelegate = delegate == null ? new ChromeWebContentsDelegateA ndroid() : delegate;
63 nativeInitWebContentsDelegate(mNativeTabBaseAndroidImpl, mWebContentsDel egate); 63 nativeInitWebContentsDelegate(mNativeTabBaseAndroidImpl, mWebContentsDel egate);
64 64
65 // To be called after everything is initialized. 65 // To be called after everything is initialized.
66 mCleanupReference = new CleanupReference(this, 66 mCleanupReference = new CleanupReference(this,
67 new DestroyRunnable(mNativeTabBaseAndroidImpl)); 67 new DestroyRunnable(mNativeTabBaseAndroidImpl));
68 } 68 }
69 69
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 private final int mNativeTabBaseAndroidImpl; 124 private final int mNativeTabBaseAndroidImpl;
125 private DestroyRunnable(int nativeTabBaseAndroidImpl) { 125 private DestroyRunnable(int nativeTabBaseAndroidImpl) {
126 mNativeTabBaseAndroidImpl = nativeTabBaseAndroidImpl; 126 mNativeTabBaseAndroidImpl = nativeTabBaseAndroidImpl;
127 } 127 }
128 @Override 128 @Override
129 public void run() { 129 public void run() {
130 nativeDestroy(mNativeTabBaseAndroidImpl); 130 nativeDestroy(mNativeTabBaseAndroidImpl);
131 } 131 }
132 } 132 }
133 133
134 private native int nativeInit(int webContentsPtr); 134 private native int nativeInit(int webContentsPtr, int windowAndroidPtr);
135 private static native void nativeDestroy(int nativeTabBaseAndroidImpl); 135 private static native void nativeDestroy(int nativeTabBaseAndroidImpl);
136 private native void nativeInitWebContentsDelegate(int nativeTabBaseAndroidIm pl, 136 private native void nativeInitWebContentsDelegate(int nativeTabBaseAndroidIm pl,
137 ChromeWebContentsDelegateAndroid chromeWebContentsDelegateAndroid); 137 ChromeWebContentsDelegateAndroid chromeWebContentsDelegateAndroid);
138 private native String nativeFixupUrl(int nativeTabBaseAndroidImpl, String ur l); 138 private native String nativeFixupUrl(int nativeTabBaseAndroidImpl, String ur l);
139 } 139 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/tab_base_android_impl.h » ('j') | chrome/browser/ui/android/window_android_helper.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698