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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java

Issue 2430153006: Forward touch events from the toolbar to the NTP only if the fakebox hasn't reached the top of the … (Closed)
Patch Set: review Created 4 years, 2 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.toolbar; 5 package org.chromium.chrome.browser.toolbar;
6 6
7 import android.animation.Animator; 7 import android.animation.Animator;
8 import android.animation.AnimatorListenerAdapter; 8 import android.animation.AnimatorListenerAdapter;
9 import android.animation.AnimatorSet; 9 import android.animation.AnimatorSet;
10 import android.animation.ObjectAnimator; 10 import android.animation.ObjectAnimator;
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 && mNtpSearchBoxScrollPercent != 1f 445 && mNtpSearchBoxScrollPercent != 1f
446 && mNtpSearchBoxScrollPercent != UNINITIALIZED_PERCENT) { 446 && mNtpSearchBoxScrollPercent != UNINITIALIZED_PERCENT) {
447 return true; 447 return true;
448 } 448 }
449 449
450 return super.onInterceptTouchEvent(ev); 450 return super.onInterceptTouchEvent(ev);
451 } 451 }
452 452
453 @Override 453 @Override
454 public boolean onTouchEvent(MotionEvent ev) { 454 public boolean onTouchEvent(MotionEvent ev) {
455 // Forward touch events to the NTP if the toolbar is moved away. 455 // Forward touch events to the NTP if the toolbar is moved away but the search box hasn't
456 if (mNtpSearchBoxTranslation.y < 0) { 456 // reached the top of the page yet.
457 if (mNtpSearchBoxTranslation.y < 0 && mLocationBar.getTranslationY() > 0 ) {
457 NewTabPage newTabPage = getToolbarDataProvider().getNewTabPageForCur rentTab(); 458 NewTabPage newTabPage = getToolbarDataProvider().getNewTabPageForCur rentTab();
458 459
459 // No null check -- the toolbar should not be moved if we are not on an NTP. 460 // No null check -- the toolbar should not be moved if we are not on an NTP.
460 return newTabPage.getView().dispatchTouchEvent(ev); 461 return newTabPage.getView().dispatchTouchEvent(ev);
461 } 462 }
462 return super.onTouchEvent(ev); 463 return super.onTouchEvent(ev);
463 } 464 }
464 465
465 @Override 466 @Override
466 public void onClick(View v) { 467 public void onClick(View v) {
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after
2235 }); 2236 });
2236 2237
2237 if (mFullscreenManager != null) { 2238 if (mFullscreenManager != null) {
2238 mFullscreenCalloutToken = 2239 mFullscreenCalloutToken =
2239 mFullscreenManager.showControlsPersistentAndClearOldToken( 2240 mFullscreenManager.showControlsPersistentAndClearOldToken(
2240 mFullscreenCalloutToken); 2241 mFullscreenCalloutToken);
2241 } 2242 }
2242 } 2243 }
2243 } 2244 }
2244 2245
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