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

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 369503003: Migration of code from ContentViewCore to NavigationController to avoid ContentViewCore abstraction… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed style issues in functions Created 6 years, 5 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.app.Activity; 8 import android.app.Activity;
9 import android.app.SearchManager; 9 import android.app.SearchManager;
10 import android.content.ContentResolver; 10 import android.content.ContentResolver;
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 * Goes to the navigation entry following the current one. 1041 * Goes to the navigation entry following the current one.
1042 */ 1042 */
1043 public void goForward() { 1043 public void goForward() {
1044 if (mWebContents != null) mWebContents.getNavigationController().goForwa rd(); 1044 if (mWebContents != null) mWebContents.getNavigationController().goForwa rd();
1045 } 1045 }
1046 1046
1047 /** 1047 /**
1048 * Loads the current navigation if there is a pending lazy load (after tab r estore). 1048 * Loads the current navigation if there is a pending lazy load (after tab r estore).
1049 */ 1049 */
1050 public void loadIfNecessary() { 1050 public void loadIfNecessary() {
1051 if (mNativeContentViewCore != 0) nativeLoadIfNecessary(mNativeContentVie wCore); 1051 if (mWebContents != null) mWebContents.getNavigationController().loadIfN ecessary();
1052 } 1052 }
1053 1053
1054 /** 1054 /**
1055 * Requests the current navigation to be loaded upon the next call to loadIf Necessary(). 1055 * Requests the current navigation to be loaded upon the next call to loadIf Necessary().
1056 */ 1056 */
1057 public void requestRestoreLoad() { 1057 public void requestRestoreLoad() {
1058 if (mNativeContentViewCore != 0) nativeRequestRestoreLoad(mNativeContent ViewCore); 1058 if (mWebContents != null) mWebContents.getNavigationController().request RestoreLoad();
1059 } 1059 }
1060 1060
1061 /** 1061 /**
1062 * Reload the current page. 1062 * Reload the current page.
1063 */ 1063 */
1064 public void reload(boolean checkForRepost) { 1064 public void reload(boolean checkForRepost) {
1065 mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary(); 1065 mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary();
1066 if (mNativeContentViewCore != 0) { 1066 if (mWebContents != null) mWebContents.getNavigationController().reload( checkForRepost);
1067 nativeReload(mNativeContentViewCore, checkForRepost);
1068 }
1069 } 1067 }
1070 1068
1071 /** 1069 /**
1072 * Reload the current page, ignoring the contents of the cache. 1070 * Reload the current page, ignoring the contents of the cache.
1073 */ 1071 */
1074 public void reloadIgnoringCache(boolean checkForRepost) { 1072 public void reloadIgnoringCache(boolean checkForRepost) {
1075 mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary(); 1073 mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary();
1076 if (mNativeContentViewCore != 0) { 1074 if (mWebContents != null) mWebContents.getNavigationController().reloadI gnoringCache(
1077 nativeReloadIgnoringCache(mNativeContentViewCore, checkForRepost); 1075 checkForRepost);
1078 }
1079 } 1076 }
1080 1077
1081 /** 1078 /**
1082 * Cancel the pending reload. 1079 * Cancel the pending reload.
1083 */ 1080 */
1084 public void cancelPendingReload() { 1081 public void cancelPendingReload() {
1085 if (mNativeContentViewCore != 0) nativeCancelPendingReload(mNativeConten tViewCore); 1082 if (mWebContents != null) mWebContents.getNavigationController().cancelP endingReload();
1086 } 1083 }
1087 1084
1088 /** 1085 /**
1089 * Continue the pending reload. 1086 * Continue the pending reload.
1090 */ 1087 */
1091 public void continuePendingReload() { 1088 public void continuePendingReload() {
1092 if (mNativeContentViewCore != 0) nativeContinuePendingReload(mNativeCont entViewCore); 1089 if (mWebContents != null) mWebContents.getNavigationController().continu ePendingReload();
1093 } 1090 }
1094 1091
1095 /** 1092 /**
1096 * Clears the ContentViewCore's page history in both the backwards and 1093 * Clears the ContentViewCore's page history in both the backwards and
1097 * forwards directions. 1094 * forwards directions.
1098 */ 1095 */
1099 public void clearHistory() { 1096 public void clearHistory() {
1100 if (mNativeContentViewCore != 0) nativeClearHistory(mNativeContentViewCo re); 1097 if (mNativeContentViewCore != 0) nativeClearHistory(mNativeContentViewCo re);
1101 } 1098 }
1102 1099
(...skipping 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after
3264 long nativeContentViewCoreImpl, float x1, float y1, float x2, float y2); 3261 long nativeContentViewCoreImpl, float x1, float y1, float x2, float y2);
3265 3262
3266 private native void nativeMoveCaret(long nativeContentViewCoreImpl, float x, float y); 3263 private native void nativeMoveCaret(long nativeContentViewCoreImpl, float x, float y);
3267 3264
3268 private native void nativeResetGestureDetection(long nativeContentViewCoreIm pl); 3265 private native void nativeResetGestureDetection(long nativeContentViewCoreIm pl);
3269 private native void nativeSetDoubleTapSupportEnabled( 3266 private native void nativeSetDoubleTapSupportEnabled(
3270 long nativeContentViewCoreImpl, boolean enabled); 3267 long nativeContentViewCoreImpl, boolean enabled);
3271 private native void nativeSetMultiTouchZoomSupportEnabled( 3268 private native void nativeSetMultiTouchZoomSupportEnabled(
3272 long nativeContentViewCoreImpl, boolean enabled); 3269 long nativeContentViewCoreImpl, boolean enabled);
3273 3270
3274 private native void nativeLoadIfNecessary(long nativeContentViewCoreImpl);
3275 private native void nativeRequestRestoreLoad(long nativeContentViewCoreImpl) ;
3276
3277 private native void nativeReload(long nativeContentViewCoreImpl, boolean che ckForRepost);
3278 private native void nativeReloadIgnoringCache(
3279 long nativeContentViewCoreImpl, boolean checkForRepost);
3280
3281 private native void nativeCancelPendingReload(long nativeContentViewCoreImpl );
3282
3283 private native void nativeContinuePendingReload(long nativeContentViewCoreIm pl);
3284
3285 private native void nativeSelectPopupMenuItems(long nativeContentViewCoreImp l, int[] indices); 3271 private native void nativeSelectPopupMenuItems(long nativeContentViewCoreImp l, int[] indices);
3286 3272
3287 private native void nativeScrollFocusedEditableNodeIntoView(long nativeConte ntViewCoreImpl); 3273 private native void nativeScrollFocusedEditableNodeIntoView(long nativeConte ntViewCoreImpl);
3288 3274
3289 private native void nativeSelectWordAroundCaret(long nativeContentViewCoreIm pl); 3275 private native void nativeSelectWordAroundCaret(long nativeContentViewCoreIm pl);
3290 3276
3291 private native void nativeClearHistory(long nativeContentViewCoreImpl); 3277 private native void nativeClearHistory(long nativeContentViewCoreImpl);
3292 3278
3293 private native void nativeAddStyleSheetByURL(long nativeContentViewCoreImpl, 3279 private native void nativeAddStyleSheetByURL(long nativeContentViewCoreImpl,
3294 String stylesheetUrl); 3280 String stylesheetUrl);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
3341 3327
3342 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l, 3328 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l,
3343 int x, int y, int w, int h); 3329 int x, int y, int w, int h);
3344 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); 3330 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque);
3345 3331
3346 private native void nativeResumeResponseDeferredAtStart( 3332 private native void nativeResumeResponseDeferredAtStart(
3347 long nativeContentViewCoreImpl); 3333 long nativeContentViewCoreImpl);
3348 private native void nativeSetHasPendingNavigationTransitionForTesting( 3334 private native void nativeSetHasPendingNavigationTransitionForTesting(
3349 long nativeContentViewCoreImpl); 3335 long nativeContentViewCoreImpl);
3350 } 3336 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698