| 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.app.Activity; | 8 import android.app.Activity; |
| 9 import android.app.ActivityManager; | 9 import android.app.ActivityManager; |
| 10 import android.app.Dialog; | 10 import android.app.Dialog; |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 } | 647 } |
| 648 | 648 |
| 649 private boolean isInSingleUrlBarMode(Context context) { | 649 private boolean isInSingleUrlBarMode(Context context) { |
| 650 if (mIsTablet) return false; | 650 if (mIsTablet) return false; |
| 651 if (mOptOutPromoShown) return false; | 651 if (mOptOutPromoShown) return false; |
| 652 | 652 |
| 653 return mSearchProviderHasLogo; | 653 return mSearchProviderHasLogo; |
| 654 } | 654 } |
| 655 | 655 |
| 656 private void updateSearchProviderHasLogo() { | 656 private void updateSearchProviderHasLogo() { |
| 657 if (CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_NTP_SNIPPE
TS)) { | 657 if (ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS)) { |
| 658 mSearchProviderHasLogo = false; | 658 mSearchProviderHasLogo = false; |
| 659 if (mNewTabPageView != null) mNewTabPageView.setSearchProviderHasLog
o(false); | 659 if (mNewTabPageView != null) mNewTabPageView.setSearchProviderHasLog
o(false); |
| 660 } else { | 660 } else { |
| 661 mSearchProviderHasLogo = !mOptOutPromoShown | 661 mSearchProviderHasLogo = !mOptOutPromoShown |
| 662 && TemplateUrlService.getInstance().isDefaultSearchEngineGoo
gle(); | 662 && TemplateUrlService.getInstance().isDefaultSearchEngineGoo
gle(); |
| 663 } | 663 } |
| 664 } | 664 } |
| 665 | 665 |
| 666 private void onSearchEngineUpdated() { | 666 private void onSearchEngineUpdated() { |
| 667 // TODO(newt): update this if other search providers provide logos. | 667 // TODO(newt): update this if other search providers provide logos. |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 @Override | 828 @Override |
| 829 public boolean shouldCaptureThumbnail() { | 829 public boolean shouldCaptureThumbnail() { |
| 830 return mNewTabPageView.shouldCaptureThumbnail(); | 830 return mNewTabPageView.shouldCaptureThumbnail(); |
| 831 } | 831 } |
| 832 | 832 |
| 833 @Override | 833 @Override |
| 834 public void captureThumbnail(Canvas canvas) { | 834 public void captureThumbnail(Canvas canvas) { |
| 835 mNewTabPageView.captureThumbnail(canvas); | 835 mNewTabPageView.captureThumbnail(canvas); |
| 836 } | 836 } |
| 837 } | 837 } |
| OLD | NEW |