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

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

Issue 2380743003: Refactor ContentViewClient (2/6) (Closed)
Patch Set: // Do nothing Created 4 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 org.chromium.android_webview.AwContents.VisualStateCallback; 7 import org.chromium.android_webview.AwContents.VisualStateCallback;
8 import org.chromium.base.ThreadUtils; 8 import org.chromium.base.ThreadUtils;
9 import org.chromium.content_public.browser.WebContents; 9 import org.chromium.content_public.browser.WebContents;
10 import org.chromium.content_public.browser.WebContentsObserver; 10 import org.chromium.content_public.browser.WebContentsObserver;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 boolean isErrorUrl = 73 boolean isErrorUrl =
74 unreachableWebDataUrl != null && unreachableWebDataUrl.equals(fa ilingUrl); 74 unreachableWebDataUrl != null && unreachableWebDataUrl.equals(fa ilingUrl);
75 if (isMainFrame && !isErrorUrl && errorCode == NetError.ERR_ABORTED) { 75 if (isMainFrame && !isErrorUrl && errorCode == NetError.ERR_ABORTED) {
76 // Need to call onPageFinished for backwards compatibility with the classic webview. 76 // Need to call onPageFinished for backwards compatibility with the classic webview.
77 // See also AwContents.IoThreadClientImpl.onReceivedError. 77 // See also AwContents.IoThreadClientImpl.onReceivedError.
78 client.getCallbackHelper().postOnPageFinished(failingUrl); 78 client.getCallbackHelper().postOnPageFinished(failingUrl);
79 } 79 }
80 } 80 }
81 81
82 @Override 82 @Override
83 public void titleWasSet(String title) {
84 AwContentsClient client = mAwContentsClient.get();
85 if (client == null) return;
86 client.updateTitle(title, true);
87 }
88
89 @Override
83 public void didNavigateMainFrame(final String url, String baseUrl, 90 public void didNavigateMainFrame(final String url, String baseUrl,
84 boolean isNavigationToDifferentPage, boolean isFragmentNavigation, i nt statusCode) { 91 boolean isNavigationToDifferentPage, boolean isFragmentNavigation, i nt statusCode) {
85 // Only invoke the onPageCommitVisible callback when navigating to a dif ferent page, 92 // Only invoke the onPageCommitVisible callback when navigating to a dif ferent page,
86 // but not when navigating to a different fragment within the same page. 93 // but not when navigating to a different fragment within the same page.
87 if (isNavigationToDifferentPage) { 94 if (isNavigationToDifferentPage) {
88 ThreadUtils.postOnUiThread(new Runnable() { 95 ThreadUtils.postOnUiThread(new Runnable() {
89 @Override 96 @Override
90 public void run() { 97 public void run() {
91 AwContents awContents = mAwContents.get(); 98 AwContents awContents = mAwContents.get();
92 if (awContents != null) { 99 if (awContents != null) {
(...skipping 25 matching lines...) Expand all
118 mCommittedNavigation = true; 125 mCommittedNavigation = true;
119 final AwContentsClient client = mAwContentsClient.get(); 126 final AwContentsClient client = mAwContentsClient.get();
120 if (client == null) return; 127 if (client == null) return;
121 client.getCallbackHelper().postDoUpdateVisitedHistory(url, isReload); 128 client.getCallbackHelper().postDoUpdateVisitedHistory(url, isReload);
122 } 129 }
123 130
124 public boolean didEverCommitNavigation() { 131 public boolean didEverCommitNavigation() {
125 return mCommittedNavigation; 132 return mCommittedNavigation;
126 } 133 }
127 } 134 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698