OLD | NEW |
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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 | 399 |
400 /** | 400 /** |
401 * Updates whether the NewTabPage should animate on URL focus changes. | 401 * Updates whether the NewTabPage should animate on URL focus changes. |
402 * @param disable Whether to disable the animations. | 402 * @param disable Whether to disable the animations. |
403 */ | 403 */ |
404 public void setUrlFocusAnimationsDisabled(boolean disable) { | 404 public void setUrlFocusAnimationsDisabled(boolean disable) { |
405 mNewTabPageView.setUrlFocusAnimationsDisabled(disable); | 405 mNewTabPageView.setUrlFocusAnimationsDisabled(disable); |
406 } | 406 } |
407 | 407 |
408 private boolean isInSingleUrlBarMode(Context context) { | 408 private boolean isInSingleUrlBarMode(Context context) { |
409 if (DeviceFormFactor.isTablet(context)) return false; | 409 if (DeviceFormFactor.isTablet()) return false; |
410 if (FeatureUtilities.isChromeHomeEnabled()) return false; | 410 if (FeatureUtilities.isChromeHomeEnabled()) return false; |
411 return mSearchProviderHasLogo; | 411 return mSearchProviderHasLogo; |
412 } | 412 } |
413 | 413 |
414 private void updateSearchProviderHasLogo() { | 414 private void updateSearchProviderHasLogo() { |
415 mSearchProviderHasLogo = TemplateUrlService.getInstance().isDefaultSearc
hEngineGoogle(); | 415 mSearchProviderHasLogo = TemplateUrlService.getInstance().isDefaultSearc
hEngineGoogle(); |
416 } | 416 } |
417 | 417 |
418 private void onSearchEngineUpdated() { | 418 private void onSearchEngineUpdated() { |
419 // TODO(newt): update this if other search providers provide logos. | 419 // TODO(newt): update this if other search providers provide logos. |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 @Override | 617 @Override |
618 public void captureThumbnail(Canvas canvas) { | 618 public void captureThumbnail(Canvas canvas) { |
619 mNewTabPageView.captureThumbnail(canvas); | 619 mNewTabPageView.captureThumbnail(canvas); |
620 } | 620 } |
621 | 621 |
622 @VisibleForTesting | 622 @VisibleForTesting |
623 public NewTabPageManager getManagerForTesting() { | 623 public NewTabPageManager getManagerForTesting() { |
624 return mNewTabPageManager; | 624 return mNewTabPageManager; |
625 } | 625 } |
626 } | 626 } |
OLD | NEW |