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

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

Issue 2106753002: Refine snap scrolling on the Cards New Tab Page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment. Created 4 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.ntp; 5 package org.chromium.chrome.browser.ntp;
6 6
7 import android.annotation.TargetApi; 7 import android.annotation.TargetApi;
8 import android.app.Activity; 8 import android.app.Activity;
9 import android.app.Dialog; 9 import android.app.Dialog;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 .setAction(context.getString(R.string.undo), url); 631 .setAction(context.getString(R.string.undo), url);
632 mTab.getSnackbarManager().showSnackbar(snackbar); 632 mTab.getSnackbarManager().showSnackbar(snackbar);
633 } 633 }
634 634
635 /** @return The view container for the new tab page. */ 635 /** @return The view container for the new tab page. */
636 @VisibleForTesting 636 @VisibleForTesting
637 NewTabPageView getNewTabPageView() { 637 NewTabPageView getNewTabPageView() {
638 return mNewTabPageView; 638 return mNewTabPageView;
639 } 639 }
640 640
641 /** @return whether the NTP is using the cards UI. */
642 public boolean isCardsUiEnabled() {
643 return SnippetsConfig.isEnabled();
644 }
645
641 /** 646 /**
642 * Updates whether the NewTabPage should animate on URL focus changes. 647 * Updates whether the NewTabPage should animate on URL focus changes.
643 * @param disable Whether to disable the animations. 648 * @param disable Whether to disable the animations.
644 */ 649 */
645 public void setUrlFocusAnimationsDisabled(boolean disable) { 650 public void setUrlFocusAnimationsDisabled(boolean disable) {
646 mNewTabPageView.setUrlFocusAnimationsDisabled(disable); 651 mNewTabPageView.setUrlFocusAnimationsDisabled(disable);
647 } 652 }
648 653
649 private boolean isInSingleUrlBarMode(Context context) { 654 private boolean isInSingleUrlBarMode(Context context) {
650 if (DeviceFormFactor.isTablet(context)) return false; 655 if (DeviceFormFactor.isTablet(context)) return false;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 @Override 825 @Override
821 public boolean shouldCaptureThumbnail() { 826 public boolean shouldCaptureThumbnail() {
822 return mNewTabPageView.shouldCaptureThumbnail(); 827 return mNewTabPageView.shouldCaptureThumbnail();
823 } 828 }
824 829
825 @Override 830 @Override
826 public void captureThumbnail(Canvas canvas) { 831 public void captureThumbnail(Canvas canvas) {
827 mNewTabPageView.captureThumbnail(canvas); 832 mNewTabPageView.captureThumbnail(canvas);
828 } 833 }
829 } 834 }
OLDNEW
« no previous file with comments | « chrome/android/java/res/values/dimens.xml ('k') | chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698