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.toolbar; | 5 package org.chromium.chrome.browser.toolbar; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.text.TextUtils; | 8 import android.text.TextUtils; |
9 | 9 |
10 import org.chromium.base.ApiCompatibilityUtils; | 10 import org.chromium.base.ApiCompatibilityUtils; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 public NewTabPage getNewTabPageForCurrentTab() { | 80 public NewTabPage getNewTabPageForCurrentTab() { |
81 Tab currentTab = getTab(); | 81 Tab currentTab = getTab(); |
82 if (currentTab != null && currentTab.getNativePage() instanceof NewTabPa
ge) { | 82 if (currentTab != null && currentTab.getNativePage() instanceof NewTabPa
ge) { |
83 return (NewTabPage) currentTab.getNativePage(); | 83 return (NewTabPage) currentTab.getNativePage(); |
84 } | 84 } |
85 return null; | 85 return null; |
86 } | 86 } |
87 | 87 |
88 @Override | 88 @Override |
89 public String getText() { | 89 public String getText() { |
| 90 if (mTab != null && mTab.isBlimpTab()) return mTab.getUrl().trim(); |
| 91 |
90 String displayText = super.getText(); | 92 String displayText = super.getText(); |
91 | 93 |
92 if (mTab == null || mTab.isFrozen()) return displayText; | 94 if (mTab == null || mTab.isFrozen()) return displayText; |
93 | 95 |
94 String url = mTab.getUrl().trim(); | 96 String url = mTab.getUrl().trim(); |
95 if (DomDistillerUrlUtils.isDistilledPage(url)) { | 97 if (DomDistillerUrlUtils.isDistilledPage(url)) { |
96 if (isStoredArticle(url)) { | 98 if (isStoredArticle(url)) { |
97 DomDistillerService domDistillerService = | 99 DomDistillerService domDistillerService = |
98 DomDistillerServiceFactory.getForProfile(mTab.getProfile
()); | 100 DomDistillerServiceFactory.getForProfile(mTab.getProfile
()); |
99 String originalUrl = domDistillerService.getUrlForEntry( | 101 String originalUrl = domDistillerService.getUrlForEntry( |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 @Override | 145 @Override |
144 public int getPrimaryColor() { | 146 public int getPrimaryColor() { |
145 return mPrimaryColor; | 147 return mPrimaryColor; |
146 } | 148 } |
147 | 149 |
148 @Override | 150 @Override |
149 public boolean isUsingBrandColor() { | 151 public boolean isUsingBrandColor() { |
150 return mIsUsingBrandColor; | 152 return mIsUsingBrandColor; |
151 } | 153 } |
152 } | 154 } |
OLD | NEW |