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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java

Issue 2891423002: Disable NTP URL bar while in VR on Android. (Closed)
Patch Set: Make focusSearchBox aware of VR Created 3 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.ntp; 5 package org.chromium.chrome.browser.ntp;
6 6
7 import android.annotation.TargetApi; 7 import android.annotation.TargetApi;
8 import android.content.Context; 8 import android.content.Context;
9 import android.graphics.Canvas; 9 import android.graphics.Canvas;
10 import android.graphics.Point; 10 import android.graphics.Point;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 import org.chromium.chrome.browser.suggestions.TileGroupDelegateImpl; 51 import org.chromium.chrome.browser.suggestions.TileGroupDelegateImpl;
52 import org.chromium.chrome.browser.sync.SyncSessionsMetrics; 52 import org.chromium.chrome.browser.sync.SyncSessionsMetrics;
53 import org.chromium.chrome.browser.tab.EmptyTabObserver; 53 import org.chromium.chrome.browser.tab.EmptyTabObserver;
54 import org.chromium.chrome.browser.tab.Tab; 54 import org.chromium.chrome.browser.tab.Tab;
55 import org.chromium.chrome.browser.tab.TabObserver; 55 import org.chromium.chrome.browser.tab.TabObserver;
56 import org.chromium.chrome.browser.tabmodel.TabModel; 56 import org.chromium.chrome.browser.tabmodel.TabModel;
57 import org.chromium.chrome.browser.tabmodel.TabModelSelector; 57 import org.chromium.chrome.browser.tabmodel.TabModelSelector;
58 import org.chromium.chrome.browser.tabmodel.TabModelUtils; 58 import org.chromium.chrome.browser.tabmodel.TabModelUtils;
59 import org.chromium.chrome.browser.util.FeatureUtilities; 59 import org.chromium.chrome.browser.util.FeatureUtilities;
60 import org.chromium.chrome.browser.util.UrlUtilities; 60 import org.chromium.chrome.browser.util.UrlUtilities;
61 import org.chromium.chrome.browser.vr_shell.VrShellDelegate;
61 import org.chromium.content_public.browser.NavigationController; 62 import org.chromium.content_public.browser.NavigationController;
62 import org.chromium.content_public.browser.NavigationEntry; 63 import org.chromium.content_public.browser.NavigationEntry;
63 import org.chromium.net.NetworkChangeNotifier; 64 import org.chromium.net.NetworkChangeNotifier;
64 import org.chromium.ui.base.DeviceFormFactor; 65 import org.chromium.ui.base.DeviceFormFactor;
65 import org.chromium.ui.mojom.WindowOpenDisposition; 66 import org.chromium.ui.mojom.WindowOpenDisposition;
66 67
67 import java.util.concurrent.TimeUnit; 68 import java.util.concurrent.TimeUnit;
68 69
69 /** 70 /**
70 * Provides functionality when the user interacts with the NTP. 71 * Provides functionality when the user interacts with the NTP.
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 222 }
222 223
223 private boolean matchURLs(String url1, String url2, boolean matchByHost) { 224 private boolean matchURLs(String url1, String url2, boolean matchByHost) {
224 if (url1 == null || url2 == null) return false; 225 if (url1 == null || url2 == null) return false;
225 return matchByHost ? UrlUtilities.sameHost(url1, url2) : url1.equals (url2); 226 return matchByHost ? UrlUtilities.sameHost(url1, url2) : url1.equals (url2);
226 } 227 }
227 228
228 @Override 229 @Override
229 public void focusSearchBox(boolean beginVoiceSearch, String pastedText) { 230 public void focusSearchBox(boolean beginVoiceSearch, String pastedText) {
230 if (mIsDestroyed) return; 231 if (mIsDestroyed) return;
232 if (VrShellDelegate.isInVr()) return;
231 if (mFakeboxDelegate != null) { 233 if (mFakeboxDelegate != null) {
232 if (beginVoiceSearch) { 234 if (beginVoiceSearch) {
233 mFakeboxDelegate.startVoiceRecognition(); 235 mFakeboxDelegate.startVoiceRecognition();
234 } else { 236 } else {
235 mFakeboxDelegate.requestUrlFocusFromFakebox(pastedText); 237 mFakeboxDelegate.requestUrlFocusFromFakebox(pastedText);
236 } 238 }
237 } 239 }
238 } 240 }
239 241
240 @Override 242 @Override
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 @Override 619 @Override
618 public void captureThumbnail(Canvas canvas) { 620 public void captureThumbnail(Canvas canvas) {
619 mNewTabPageView.captureThumbnail(canvas); 621 mNewTabPageView.captureThumbnail(canvas);
620 } 622 }
621 623
622 @VisibleForTesting 624 @VisibleForTesting
623 public NewTabPageManager getManagerForTesting() { 625 public NewTabPageManager getManagerForTesting() {
624 return mNewTabPageManager; 626 return mNewTabPageManager;
625 } 627 }
626 } 628 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698