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

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

Issue 2901023002: Disable learning text suggestions if in incognito. (Closed)
Patch Set: Created 3 years, 7 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 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after
2242 * Update the location bar visuals based on a loading state change. 2242 * Update the location bar visuals based on a loading state change.
2243 * @param updateUrl Whether to update the URL as a result of the this call. 2243 * @param updateUrl Whether to update the URL as a result of the this call.
2244 */ 2244 */
2245 @Override 2245 @Override
2246 public void updateLoadingState(boolean updateUrl) { 2246 public void updateLoadingState(boolean updateUrl) {
2247 if (updateUrl) setUrlToPageUrl(); 2247 if (updateUrl) setUrlToPageUrl();
2248 updateNavigationButton(); 2248 updateNavigationButton();
2249 updateSecurityIcon(getSecurityLevel()); 2249 updateSecurityIcon(getSecurityLevel());
2250 } 2250 }
2251 2251
2252 /**
2253 * @return The Tab currently showing.
2254 */
2255 @Override 2252 @Override
2256 public Tab getCurrentTab() { 2253 public Tab getCurrentTab() {
2257 if (mToolbarDataProvider == null) return null; 2254 if (mToolbarDataProvider == null) return null;
2258 return mToolbarDataProvider.getTab(); 2255 return mToolbarDataProvider.getTab();
2259 } 2256 }
2260 2257
2258 @Override
2259 public boolean isIncognito() {
2260 if (mToolbarDataProvider == null) return false;
Changwan Ryu 2017/05/23 19:47:47 We actually set an empty version in ToolbarLayout#
Ted C 2017/05/23 20:07:19 The null check here is for consistency with above.
Ted C 2017/05/23 21:09:15 Per the offline discussion, this was more around u
2261 return mToolbarDataProvider.isIncognito();
2262 }
2263
2261 private void initOmniboxResultsContainer() { 2264 private void initOmniboxResultsContainer() {
2262 if (mOmniboxResultsContainer != null) return; 2265 if (mOmniboxResultsContainer != null) return;
2263 2266
2264 // Use the omnibox results container in the bottom sheet if it exists. 2267 // Use the omnibox results container in the bottom sheet if it exists.
2265 int omniboxResultsContainerId = R.id.omnibox_results_container_stub; 2268 int omniboxResultsContainerId = R.id.omnibox_results_container_stub;
2266 if (mBottomSheet != null) { 2269 if (mBottomSheet != null) {
2267 omniboxResultsContainerId = R.id.bottom_omnibox_results_container_st ub; 2270 omniboxResultsContainerId = R.id.bottom_omnibox_results_container_st ub;
2268 } 2271 }
2269 2272
2270 ViewStub overlayStub = (ViewStub) getRootView().findViewById(omniboxResu ltsContainerId); 2273 ViewStub overlayStub = (ViewStub) getRootView().findViewById(omniboxResu ltsContainerId);
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
2525 public void setTitleToPageTitle() { } 2528 public void setTitleToPageTitle() { }
2526 2529
2527 @Override 2530 @Override
2528 public void setShowTitle(boolean showTitle) { } 2531 public void setShowTitle(boolean showTitle) { }
2529 2532
2530 @Override 2533 @Override
2531 public boolean mustQueryUrlBarLocationForSuggestions() { 2534 public boolean mustQueryUrlBarLocationForSuggestions() {
2532 return DeviceFormFactor.isTablet(); 2535 return DeviceFormFactor.isTablet();
2533 } 2536 }
2534 } 2537 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698