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

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

Issue 2245733004: Serve offline page for online URL on disconnected or bad networks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.omnibox; 5 package org.chromium.chrome.browser.omnibox;
6 6
7 import static org.chromium.chrome.browser.toolbar.ToolbarPhone.URL_FOCUS_CHANGE_ ANIMATION_DURATION_MS; 7 import static org.chromium.chrome.browser.toolbar.ToolbarPhone.URL_FOCUS_CHANGE_ ANIMATION_DURATION_MS;
8 8
9 import android.Manifest; 9 import android.Manifest;
10 import android.animation.Animator; 10 import android.animation.Animator;
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 } 2058 }
2059 2059
2060 if (setUrlBarText(url, mToolbarDataProvider.getText())) { 2060 if (setUrlBarText(url, mToolbarDataProvider.getText())) {
2061 mUrlBar.deEmphasizeUrl(); 2061 mUrlBar.deEmphasizeUrl();
2062 emphasizeUrl(); 2062 emphasizeUrl();
2063 } 2063 }
2064 updateCustomSelectionActionModeCallback(); 2064 updateCustomSelectionActionModeCallback();
2065 } 2065 }
2066 2066
2067 /** 2067 /**
2068 * Gets the URL of the web page in the tab. When displaying offline page it gets the URL of the 2068 * Gets the URL of the web page in the tab.
fgorski 2016/08/15 21:38:32 nit: sinle line: /** Gets the URL of the web page
jianli 2016/08/15 23:15:43 Done.
2069 * original page.
2070 */ 2069 */
2071 private String getOnlineUrlFromTab() { 2070 private String getOnlineUrlFromTab() {
2072 Tab currentTab = getCurrentTab(); 2071 Tab currentTab = getCurrentTab();
2073 if (currentTab == null) return ""; 2072 if (currentTab == null) return "";
2074 if (currentTab.isOfflinePage()) {
2075 return currentTab.getOriginalUrl().trim();
2076 }
2077 return currentTab.getUrl().trim(); 2073 return currentTab.getUrl().trim();
2078 } 2074 }
2079 2075
2080 /** 2076 /**
2081 * Changes the text on the url bar 2077 * Changes the text on the url bar
2082 * @param originalText The original text (URL or search terms) for copy/cut. 2078 * @param originalText The original text (URL or search terms) for copy/cut.
2083 * @param displayText The text (URL or search terms) for user display. 2079 * @param displayText The text (URL or search terms) for user display.
2084 * @return Whether the URL was changed as a result of this call. 2080 * @return Whether the URL was changed as a result of this call.
2085 */ 2081 */
2086 private boolean setUrlBarText(String originalText, String displayText) { 2082 private boolean setUrlBarText(String originalText, String displayText) {
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2450 public View getContainerView() { 2446 public View getContainerView() {
2451 return this; 2447 return this;
2452 } 2448 }
2453 2449
2454 @Override 2450 @Override
2455 public void setTitleToPageTitle() { } 2451 public void setTitleToPageTitle() { }
2456 2452
2457 @Override 2453 @Override
2458 public void setShowTitle(boolean showTitle) { } 2454 public void setShowTitle(boolean showTitle) { }
2459 } 2455 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698