Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |