| 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; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 @Override | 87 @Override |
| 88 public int getVerticalScrollOffset() { | 88 public int getVerticalScrollOffset() { |
| 89 return mRecyclerView.computeVerticalScrollOffset(); | 89 return mRecyclerView.computeVerticalScrollOffset(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 public ContextMenuManager getContextMenuManager() { | 92 public ContextMenuManager getContextMenuManager() { |
| 93 return mContextMenuManager; | 93 return mContextMenuManager; |
| 94 } | 94 } |
| 95 | 95 |
| 96 @Override |
| 96 public void destroy() { | 97 public void destroy() { |
| 97 mSuggestionsManager.onDestroy(); | 98 mSuggestionsManager.onDestroy(); |
| 98 mTileGroupDelegate.destroy(); | 99 mTileGroupDelegate.destroy(); |
| 99 } | 100 } |
| 100 | 101 |
| 102 @Override |
| 103 public String getMetricsName() { |
| 104 return "Suggestions"; |
| 105 } |
| 106 |
| 101 public static void setSuggestionsSourceForTesting(SuggestionsSource suggesti
onsSource) { | 107 public static void setSuggestionsSourceForTesting(SuggestionsSource suggesti
onsSource) { |
| 102 sSuggestionsSourceForTesting = suggestionsSource; | 108 sSuggestionsSourceForTesting = suggestionsSource; |
| 103 } | 109 } |
| 104 | 110 |
| 105 public static void setMetricsReporterForTesting(SuggestionsMetricsReporter m
etricsReporter) { | 111 public static void setMetricsReporterForTesting(SuggestionsMetricsReporter m
etricsReporter) { |
| 106 sMetricsReporterForTesting = metricsReporter; | 112 sMetricsReporterForTesting = metricsReporter; |
| 107 } | 113 } |
| 108 | 114 |
| 109 private static SuggestionsUiDelegateImpl createSuggestionsDelegate(Profile p
rofile, | 115 private static SuggestionsUiDelegateImpl createSuggestionsDelegate(Profile p
rofile, |
| 110 SuggestionsNavigationDelegate navigationDelegate, NativePageHost hos
t) { | 116 SuggestionsNavigationDelegate navigationDelegate, NativePageHost hos
t) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 126 metricsReporter = sMetricsReporterForTesting; | 132 metricsReporter = sMetricsReporterForTesting; |
| 127 } | 133 } |
| 128 | 134 |
| 129 SuggestionsUiDelegateImpl delegate = new SuggestionsUiDelegateImpl( | 135 SuggestionsUiDelegateImpl delegate = new SuggestionsUiDelegateImpl( |
| 130 suggestionsSource, metricsReporter, navigationDelegate, profile,
host); | 136 suggestionsSource, metricsReporter, navigationDelegate, profile,
host); |
| 131 if (snippetsBridge != null) delegate.addDestructionObserver(snippetsBrid
ge); | 137 if (snippetsBridge != null) delegate.addDestructionObserver(snippetsBrid
ge); |
| 132 | 138 |
| 133 return delegate; | 139 return delegate; |
| 134 } | 140 } |
| 135 } | 141 } |
| OLD | NEW |