| 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.webapps; | 5 package org.chromium.chrome.browser.webapps; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.graphics.drawable.Drawable; | 8 import android.graphics.drawable.Drawable; |
| 9 import android.text.Layout; | 9 import android.text.Layout; |
| 10 import android.text.TextUtils; | 10 import android.text.TextUtils; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 155 } |
| 156 | 156 |
| 157 ApiCompatibilityUtils.setCompoundDrawablesRelativeWithIntrinsicBounds(mU
rlBar, | 157 ApiCompatibilityUtils.setCompoundDrawablesRelativeWithIntrinsicBounds(mU
rlBar, |
| 158 mCurrentIconResource, 0, 0, 0); | 158 mCurrentIconResource, 0, 0, 0); |
| 159 } | 159 } |
| 160 | 160 |
| 161 private void updateDisplayedUrl(String originalUrl, URI uri) { | 161 private void updateDisplayedUrl(String originalUrl, URI uri) { |
| 162 boolean showScheme = mCurrentIconResource == 0; | 162 boolean showScheme = mCurrentIconResource == 0; |
| 163 String displayUrl = originalUrl; | 163 String displayUrl = originalUrl; |
| 164 if (uri != null) { | 164 if (uri != null) { |
| 165 String shortenedUrl = UrlUtilities.getOriginForDisplay(uri, showSche
me); | 165 String shortenedUrl = UrlUtilities.formatUrlForSecurityDisplay(uri,
showScheme); |
| 166 if (!TextUtils.isEmpty(shortenedUrl)) displayUrl = shortenedUrl; | 166 if (!TextUtils.isEmpty(shortenedUrl)) displayUrl = shortenedUrl; |
| 167 } | 167 } |
| 168 | 168 |
| 169 mUrlBar.setText(displayUrl); | 169 mUrlBar.setText(displayUrl); |
| 170 if (!TextUtils.equals(mCurrentlyDisplayedUrl, displayUrl)) { | 170 if (!TextUtils.equals(mCurrentlyDisplayedUrl, displayUrl)) { |
| 171 mCurrentlyDisplayedUrl = displayUrl; | 171 mCurrentlyDisplayedUrl = displayUrl; |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 } | 174 } |
| OLD | NEW |