Chromium Code Reviews| 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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 633 } | 633 } |
| 634 | 634 |
| 635 private boolean isInSingleUrlBarMode(Context context) { | 635 private boolean isInSingleUrlBarMode(Context context) { |
| 636 if (mIsTablet) return false; | 636 if (mIsTablet) return false; |
| 637 if (mOptOutPromoShown) return false; | 637 if (mOptOutPromoShown) return false; |
| 638 | 638 |
| 639 return mSearchProviderHasLogo; | 639 return mSearchProviderHasLogo; |
| 640 } | 640 } |
| 641 | 641 |
| 642 private void updateSearchProviderHasLogo() { | 642 private void updateSearchProviderHasLogo() { |
| 643 if (CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_NTP_SNIPPE TS)) { | 643 if (ChromeFeatureList.isEnabled("NTPSnippets")) { |
|
Bernhard Bauer
2016/02/09 14:44:20
It seems like this should also get extract to a st
Marc Treib
2016/02/10 11:18:40
I've added a constant to the existing ChromeFeatur
Bernhard Bauer
2016/02/10 11:24:56
Pretty much -- although I was more thinking of put
| |
| 644 mSearchProviderHasLogo = false; | 644 mSearchProviderHasLogo = false; |
| 645 if (mNewTabPageView != null) mNewTabPageView.setSearchProviderHasLog o(false); | 645 if (mNewTabPageView != null) mNewTabPageView.setSearchProviderHasLog o(false); |
| 646 } else { | 646 } else { |
| 647 mSearchProviderHasLogo = !mOptOutPromoShown | 647 mSearchProviderHasLogo = !mOptOutPromoShown |
| 648 && TemplateUrlService.getInstance().isDefaultSearchEngineGoo gle(); | 648 && TemplateUrlService.getInstance().isDefaultSearchEngineGoo gle(); |
| 649 } | 649 } |
| 650 } | 650 } |
| 651 | 651 |
| 652 private void onSearchEngineUpdated() { | 652 private void onSearchEngineUpdated() { |
| 653 // TODO(newt): update this if other search providers provide logos. | 653 // TODO(newt): update this if other search providers provide logos. |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 810 @Override | 810 @Override |
| 811 public boolean shouldCaptureThumbnail() { | 811 public boolean shouldCaptureThumbnail() { |
| 812 return mNewTabPageView.shouldCaptureThumbnail(); | 812 return mNewTabPageView.shouldCaptureThumbnail(); |
| 813 } | 813 } |
| 814 | 814 |
| 815 @Override | 815 @Override |
| 816 public void captureThumbnail(Canvas canvas) { | 816 public void captureThumbnail(Canvas canvas) { |
| 817 mNewTabPageView.captureThumbnail(canvas); | 817 mNewTabPageView.captureThumbnail(canvas); |
| 818 } | 818 } |
| 819 } | 819 } |
| OLD | NEW |