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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java

Issue 1235383002: Stop UI jumping when clicking Contextual Search Results in Custom Tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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.customtabs; 5 package org.chromium.chrome.browser.customtabs;
6 6
7 import android.content.Intent; 7 import android.content.Intent;
8 import android.net.Uri; 8 import android.net.Uri;
9 import android.os.IBinder; 9 import android.os.IBinder;
10 import android.support.customtabs.CustomTabsIntent; 10 import android.support.customtabs.CustomTabsIntent;
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 */ 229 */
230 private void loadUrlInCurrentTab(LoadUrlParams params, long timeStamp) { 230 private void loadUrlInCurrentTab(LoadUrlParams params, long timeStamp) {
231 Intent intent = getIntent(); 231 Intent intent = getIntent();
232 IntentHandler.addReferrerAndHeaders(params, intent, this); 232 IntentHandler.addReferrerAndHeaders(params, intent, this);
233 mTab.loadUrlAndTrackFromTimestamp(params, timeStamp); 233 mTab.loadUrlAndTrackFromTimestamp(params, timeStamp);
234 } 234 }
235 235
236 @Override 236 @Override
237 public boolean createContextualSearchTab(ContentViewCore searchContentViewCo re) { 237 public boolean createContextualSearchTab(ContentViewCore searchContentViewCo re) {
238 if (mTab == null) return false; 238 if (mTab == null) return false;
239 getCurrentContentViewCore().clearSelection();
239 NavigationEntry entry = 240 NavigationEntry entry =
240 searchContentViewCore.getWebContents().getNavigationController() .getPendingEntry(); 241 searchContentViewCore.getWebContents().getNavigationController() .getPendingEntry();
241 String url = entry != null 242 String url = entry != null
242 ? entry.getUrl() : searchContentViewCore.getWebContents().getUrl (); 243 ? entry.getUrl() : searchContentViewCore.getWebContents().getUrl ();
243 mTab.loadUrl(new LoadUrlParams(url)); 244 mTab.loadUrl(new LoadUrlParams(url));
244 return false; 245 return false;
245 } 246 }
246 247
247 @Override 248 @Override
248 public SingleTabModelSelector getTabModelSelector() { 249 public SingleTabModelSelector getTabModelSelector() {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 357
357 /** 358 /**
358 * @return The {@link CustomTabIntentDataProvider} for this {@link CustomTab Activity}. For test 359 * @return The {@link CustomTabIntentDataProvider} for this {@link CustomTab Activity}. For test
359 * purposes only. 360 * purposes only.
360 */ 361 */
361 @VisibleForTesting 362 @VisibleForTesting
362 CustomTabIntentDataProvider getIntentDataProvider() { 363 CustomTabIntentDataProvider getIntentDataProvider() {
363 return mIntentDataProvider; 364 return mIntentDataProvider;
364 } 365 }
365 } 366 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698