| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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.suggestions; | 5 package org.chromium.chrome.browser.suggestions; |
| 6 | 6 |
| 7 import android.view.View; | 7 import android.view.View; |
| 8 | 8 |
| 9 import org.chromium.chrome.browser.ChromeActivity; | 9 import org.chromium.chrome.browser.ChromeActivity; |
| 10 import org.chromium.chrome.browser.NativePageHost; | 10 import org.chromium.chrome.browser.NativePageHost; |
| 11 import org.chromium.chrome.browser.ntp.ContextMenuManager; | 11 import org.chromium.chrome.browser.ntp.ContextMenuManager; |
| 12 import org.chromium.chrome.browser.ntp.cards.NewTabPageAdapter; | 12 import org.chromium.chrome.browser.ntp.cards.NewTabPageAdapter; |
| 13 import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge; | 13 import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge; |
| 14 import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource; | 14 import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource; |
| 15 import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; | 15 import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; |
| 16 import org.chromium.chrome.browser.profiles.Profile; | 16 import org.chromium.chrome.browser.profiles.Profile; |
| 17 import org.chromium.chrome.browser.tabmodel.TabModelSelector; | 17 import org.chromium.chrome.browser.tabmodel.TabModelSelector; |
| 18 import org.chromium.chrome.browser.widget.BottomSheet; | 18 import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet; |
| 19 import org.chromium.chrome.browser.widget.EmptyBottomSheetObserver; | 19 import org.chromium.chrome.browser.widget.bottomsheet.EmptyBottomSheetObserver; |
| 20 import org.chromium.chrome.browser.widget.displaystyle.UiConfig; | 20 import org.chromium.chrome.browser.widget.displaystyle.UiConfig; |
| 21 | 21 |
| 22 /** | 22 /** |
| 23 * Provides content to be displayed inside of the Home tab of bottom sheet. | 23 * Provides content to be displayed inside of the Home tab of bottom sheet. |
| 24 * | 24 * |
| 25 * TODO(dgn): If the bottom sheet view is not recreated across tab changes, it w
ill have to be | 25 * TODO(dgn): If the bottom sheet view is not recreated across tab changes, it w
ill have to be |
| 26 * notified of it, at least when it is pulled up on the new tab. | 26 * notified of it, at least when it is pulled up on the new tab. |
| 27 */ | 27 */ |
| 28 public class SuggestionsBottomSheetContent implements BottomSheet.BottomSheetCon
tent { | 28 public class SuggestionsBottomSheetContent implements BottomSheet.BottomSheetCon
tent { |
| 29 private static SuggestionsSource sSuggestionsSourceForTesting; | 29 private static SuggestionsSource sSuggestionsSourceForTesting; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 metricsReporter = sMetricsReporterForTesting; | 126 metricsReporter = sMetricsReporterForTesting; |
| 127 } | 127 } |
| 128 | 128 |
| 129 SuggestionsUiDelegateImpl delegate = new SuggestionsUiDelegateImpl( | 129 SuggestionsUiDelegateImpl delegate = new SuggestionsUiDelegateImpl( |
| 130 suggestionsSource, metricsReporter, navigationDelegate, profile,
host); | 130 suggestionsSource, metricsReporter, navigationDelegate, profile,
host); |
| 131 if (snippetsBridge != null) delegate.addDestructionObserver(snippetsBrid
ge); | 131 if (snippetsBridge != null) delegate.addDestructionObserver(snippetsBrid
ge); |
| 132 | 132 |
| 133 return delegate; | 133 return delegate; |
| 134 } | 134 } |
| 135 } | 135 } |
| OLD | NEW |