Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGroupDelegateImpl.java

Issue 2754203004: 📰 Add tests for context menu usage (Closed)
Patch Set: y Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.annotation.TargetApi; 7 import android.annotation.TargetApi;
8 import android.content.Context; 8 import android.content.Context;
9 import android.os.Build; 9 import android.os.Build;
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 if (mTileRemovedSnackbarController != null) { 112 if (mTileRemovedSnackbarController != null) {
113 mSnackbarManager.dismissSnackbars(mTileRemovedSnackbarController); 113 mSnackbarManager.dismissSnackbars(mTileRemovedSnackbarController);
114 } 114 }
115 mMostVisitedSites.destroy(); 115 mMostVisitedSites.destroy();
116 } 116 }
117 117
118 private static MostVisitedSites buildMostVisitedSites(Profile profile) { 118 private static MostVisitedSites buildMostVisitedSites(Profile profile) {
119 if (sMostVisitedSitesForTests != null) { 119 if (sMostVisitedSitesForTests != null) {
120 return sMostVisitedSitesForTests; 120 return sMostVisitedSitesForTests;
121 } else { 121 } else {
122 return new MostVisitedSites(profile); 122 return new MostVisitedSitesBridge(profile);
123 } 123 }
124 } 124 }
125 125
126 @VisibleForTesting 126 @VisibleForTesting
127 public static void setMostVisitedSitesForTests(MostVisitedSites mostVisitedS itesForTests) { 127 public static void setMostVisitedSitesForTests(MostVisitedSites mostVisitedS itesForTests) {
128 sMostVisitedSitesForTests = mostVisitedSitesForTests; 128 sMostVisitedSitesForTests = mostVisitedSitesForTests;
129 } 129 }
130 130
131 private void showTileRemovedSnackbar(String url, final Callback<String> remo valUndoneCallback) { 131 private void showTileRemovedSnackbar(String url, final Callback<String> remo valUndoneCallback) {
132 if (mTileRemovedSnackbarController == null) { 132 if (mTileRemovedSnackbarController == null) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 } 183 }
184 return false; 184 return false;
185 } 185 }
186 186
187 private static boolean matchURLs(String url1, String url2, boolean matchByHo st) { 187 private static boolean matchURLs(String url1, String url2, boolean matchByHo st) {
188 if (url1 == null || url2 == null) return false; 188 if (url1 == null || url2 == null) return false;
189 return matchByHost ? UrlUtilities.sameHost(url1, url2) : url1.equals(url 2); 189 return matchByHost ? UrlUtilities.sameHost(url1, url2) : url1.equals(url 2);
190 } 190 }
191 } 191 }
OLDNEW
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGridLayout.java ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698