| 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 | 396 |
| 397 /** | 397 /** |
| 398 * Updates whether the NewTabPage should animate on URL focus changes. | 398 * Updates whether the NewTabPage should animate on URL focus changes. |
| 399 * @param disable Whether to disable the animations. | 399 * @param disable Whether to disable the animations. |
| 400 */ | 400 */ |
| 401 public void setUrlFocusAnimationsDisabled(boolean disable) { | 401 public void setUrlFocusAnimationsDisabled(boolean disable) { |
| 402 mNewTabPageView.setUrlFocusAnimationsDisabled(disable); | 402 mNewTabPageView.setUrlFocusAnimationsDisabled(disable); |
| 403 } | 403 } |
| 404 | 404 |
| 405 private boolean isInSingleUrlBarMode(Context context) { | 405 private boolean isInSingleUrlBarMode(Context context) { |
| 406 if (DeviceFormFactor.isTablet(context)) return false; | 406 if (DeviceFormFactor.isTablet()) return false; |
| 407 if (FeatureUtilities.isChromeHomeEnabled()) return false; | 407 if (FeatureUtilities.isChromeHomeEnabled()) return false; |
| 408 return mSearchProviderHasLogo; | 408 return mSearchProviderHasLogo; |
| 409 } | 409 } |
| 410 | 410 |
| 411 private void updateSearchProviderHasLogo() { | 411 private void updateSearchProviderHasLogo() { |
| 412 mSearchProviderHasLogo = TemplateUrlService.getInstance().isDefaultSearc
hEngineGoogle(); | 412 mSearchProviderHasLogo = TemplateUrlService.getInstance().isDefaultSearc
hEngineGoogle(); |
| 413 } | 413 } |
| 414 | 414 |
| 415 private void onSearchEngineUpdated() { | 415 private void onSearchEngineUpdated() { |
| 416 // TODO(newt): update this if other search providers provide logos. | 416 // TODO(newt): update this if other search providers provide logos. |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 @Override | 606 @Override |
| 607 public boolean shouldCaptureThumbnail() { | 607 public boolean shouldCaptureThumbnail() { |
| 608 return mNewTabPageView.shouldCaptureThumbnail(); | 608 return mNewTabPageView.shouldCaptureThumbnail(); |
| 609 } | 609 } |
| 610 | 610 |
| 611 @Override | 611 @Override |
| 612 public void captureThumbnail(Canvas canvas) { | 612 public void captureThumbnail(Canvas canvas) { |
| 613 mNewTabPageView.captureThumbnail(canvas); | 613 mNewTabPageView.captureThumbnail(canvas); |
| 614 } | 614 } |
| 615 } | 615 } |
| OLD | NEW |