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

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

Issue 2806593004: [Home] Add support for snackbars in the BottomSheet (Closed)
Patch Set: Fix JavaDoc Created 3 years, 8 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 27 matching lines...) Expand all
38 private final Context mContext; 38 private final Context mContext;
39 private final SnackbarManager mSnackbarManager; 39 private final SnackbarManager mSnackbarManager;
40 private final TabModelSelector mTabModelSelector; 40 private final TabModelSelector mTabModelSelector;
41 private final SuggestionsNavigationDelegate mNavigationDelegate; 41 private final SuggestionsNavigationDelegate mNavigationDelegate;
42 private final MostVisitedSites mMostVisitedSites; 42 private final MostVisitedSites mMostVisitedSites;
43 43
44 private boolean mIsDestroyed; 44 private boolean mIsDestroyed;
45 private SnackbarController mTileRemovedSnackbarController; 45 private SnackbarController mTileRemovedSnackbarController;
46 46
47 public TileGroupDelegateImpl(ChromeActivity activity, Profile profile, 47 public TileGroupDelegateImpl(ChromeActivity activity, Profile profile,
48 TabModelSelector tabModelSelector, SuggestionsNavigationDelegate nav igationDelegate) { 48 TabModelSelector tabModelSelector, SuggestionsNavigationDelegate nav igationDelegate,
49 SnackbarManager snackbarManager) {
49 mContext = activity; 50 mContext = activity;
50 mSnackbarManager = activity.getSnackbarManager(); 51 mSnackbarManager = snackbarManager;
51 mTabModelSelector = tabModelSelector; 52 mTabModelSelector = tabModelSelector;
52 mNavigationDelegate = navigationDelegate; 53 mNavigationDelegate = navigationDelegate;
53 mMostVisitedSites = buildMostVisitedSites(profile); 54 mMostVisitedSites = buildMostVisitedSites(profile);
54 } 55 }
55 56
56 @Override 57 @Override
57 public void removeMostVisitedItem(Tile item, Callback<String> removalUndoneC allback) { 58 public void removeMostVisitedItem(Tile item, Callback<String> removalUndoneC allback) {
58 assert !mIsDestroyed; 59 assert !mIsDestroyed;
59 60
60 mMostVisitedSites.addBlacklistedUrl(item.getUrl()); 61 mMostVisitedSites.addBlacklistedUrl(item.getUrl());
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 183 }
183 } 184 }
184 return false; 185 return false;
185 } 186 }
186 187
187 private static boolean matchURLs(String url1, String url2, boolean matchByHo st) { 188 private static boolean matchURLs(String url1, String url2, boolean matchByHo st) {
188 if (url1 == null || url2 == null) return false; 189 if (url1 == null || url2 == null) return false;
189 return matchByHost ? UrlUtilities.sameHost(url1, url2) : url1.equals(url 2); 190 return matchByHost ? UrlUtilities.sameHost(url1, url2) : url1.equals(url 2);
190 } 191 }
191 } 192 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698