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

Side by Side Diff: android_webview/java/src/org/chromium/android_webview/AwContentsClient.java

Issue 139493008: [android_webview] Call onPageFinished for anchor navigations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indent Created 6 years, 10 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 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.android_webview; 5 package org.chromium.android_webview;
6 6
7 import android.content.pm.ActivityInfo; 7 import android.content.pm.ActivityInfo;
8 import android.graphics.Bitmap; 8 import android.graphics.Bitmap;
9 import android.graphics.Picture; 9 import android.graphics.Picture;
10 import android.net.http.SslError; 10 import android.net.http.SslError;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 if (!isMainFrame) { 77 if (!isMainFrame) {
78 // The Android WebView does not notify the embedder of sub-frame failures. 78 // The Android WebView does not notify the embedder of sub-frame failures.
79 return; 79 return;
80 } 80 }
81 AwContentsClient.this.onReceivedError( 81 AwContentsClient.this.onReceivedError(
82 ErrorCodeConversionHelper.convertErrorCode(errorCode), descr iption, failingUrl); 82 ErrorCodeConversionHelper.convertErrorCode(errorCode), descr iption, failingUrl);
83 } 83 }
84 84
85 @Override 85 @Override
86 public void didNavigateMainFrame(String url, String baseUrl,
87 boolean isNavigationToDifferentPage, boolean isNavigationInPage) {
88 // This is here to emulate the Classic WebView firing onPageFinished for main frame
89 // navigations where only the hash fragment changes.
90 if (isNavigationInPage) {
91 AwContentsClient.this.onPageFinished(url);
92 }
93 }
94
95 @Override
86 public void didNavigateAnyFrame(String url, String baseUrl, boolean isRe load) { 96 public void didNavigateAnyFrame(String url, String baseUrl, boolean isRe load) {
87 AwContentsClient.this.doUpdateVisitedHistory(url, isReload); 97 AwContentsClient.this.doUpdateVisitedHistory(url, isReload);
88 } 98 }
89 99
90 } 100 }
91 101
92 final void installWebContentsObserver(ContentViewCore contentViewCore) { 102 final void installWebContentsObserver(ContentViewCore contentViewCore) {
93 if (mWebContentsObserver != null) { 103 if (mWebContentsObserver != null) {
94 mWebContentsObserver.detachFromWebContents(); 104 mWebContentsObserver.detachFromWebContents();
95 } 105 }
(...skipping 16 matching lines...) Expand all
112 final void onBackgroundColorChanged(int color) { 122 final void onBackgroundColorChanged(int color) {
113 // Avoid storing the sentinal INVALID_COLOR (note that both 0 and 1 are both 123 // Avoid storing the sentinal INVALID_COLOR (note that both 0 and 1 are both
114 // fully transparent so this transpose makes no visible difference). 124 // fully transparent so this transpose makes no visible difference).
115 mCachedRendererBackgroundColor = color == INVALID_COLOR ? 1 : color; 125 mCachedRendererBackgroundColor = color == INVALID_COLOR ? 1 : color;
116 } 126 }
117 127
118 //-------------------------------------------------------------------------- ------------------ 128 //-------------------------------------------------------------------------- ------------------
119 // WebView specific methods that map directly to WebViewClient / WebChromeClient 129 // WebView specific methods that map directly to WebViewClient / WebChromeClient
120 //-------------------------------------------------------------------------- ------------------ 130 //-------------------------------------------------------------------------- ------------------
121 131
132 /**
133 * Parameters for the {@link AwContentsClient#showFileChooser} method.
134 */
122 public static class FileChooserParams { 135 public static class FileChooserParams {
123 public int mode; 136 public int mode;
124 public String acceptTypes; 137 public String acceptTypes;
125 public String title; 138 public String title;
126 public String defaultFilename; 139 public String defaultFilename;
127 public boolean capture; 140 public boolean capture;
128 } 141 }
129 142
130 public abstract void getVisitedHistory(ValueCallback<String[]> callback); 143 public abstract void getVisitedHistory(ValueCallback<String[]> callback);
131 144
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 public abstract void onFindResultReceived(int activeMatchOrdinal, int number OfMatches, 234 public abstract void onFindResultReceived(int activeMatchOrdinal, int number OfMatches,
222 boolean isDoneCounting); 235 boolean isDoneCounting);
223 236
224 /** 237 /**
225 * Called whenever there is a new content picture available. 238 * Called whenever there is a new content picture available.
226 * @param picture New picture. 239 * @param picture New picture.
227 */ 240 */
228 public abstract void onNewPicture(Picture picture); 241 public abstract void onNewPicture(Picture picture);
229 242
230 } 243 }
OLDNEW
« no previous file with comments | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698