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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java

Issue 2271923002: Remove the Offline snackbar flag check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.offlinepages; 5 package org.chromium.chrome.browser.offlinepages;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.content.IntentFilter; 10 import android.content.IntentFilter;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 return onlineUrl; 153 return onlineUrl;
154 } 154 }
155 } 155 }
156 156
157 /** 157 /**
158 * Shows the snackbar for the current tab to provide offline specific inform ation if needed. 158 * Shows the snackbar for the current tab to provide offline specific inform ation if needed.
159 * @param activity The activity owning the tab. 159 * @param activity The activity owning the tab.
160 * @param tab The current tab. 160 * @param tab The current tab.
161 */ 161 */
162 public static void showOfflineSnackbarIfNecessary(ChromeActivity activity, T ab tab) { 162 public static void showOfflineSnackbarIfNecessary(ChromeActivity activity, T ab tab) {
163 if (!OfflinePageBridge.isOfflinePagesEnabled()) return;
164
165 if (OfflinePageTabObserver.getInstance() == null) { 163 if (OfflinePageTabObserver.getInstance() == null) {
166 SnackbarController snackbarController = 164 SnackbarController snackbarController =
167 createReloadSnackbarController(activity.getTabModelSelector( )); 165 createReloadSnackbarController(activity.getTabModelSelector( ));
168 OfflinePageTabObserver.init( 166 OfflinePageTabObserver.init(
169 activity.getBaseContext(), activity.getSnackbarManager(), sn ackbarController); 167 activity.getBaseContext(), activity.getSnackbarManager(), sn ackbarController);
170 } 168 }
171 169
172 showOfflineSnackbarIfNecessary(tab); 170 showOfflineSnackbarIfNecessary(tab);
173 } 171 }
174 172
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 @VisibleForTesting 579 @VisibleForTesting
582 static void setInstanceForTesting(OfflinePageUtils instance) { 580 static void setInstanceForTesting(OfflinePageUtils instance) {
583 sInstance = instance; 581 sInstance = instance;
584 } 582 }
585 583
586 @VisibleForTesting 584 @VisibleForTesting
587 public static void setSnackbarDurationForTesting(int durationMs) { 585 public static void setSnackbarDurationForTesting(int durationMs) {
588 sSnackbarDurationMs = durationMs; 586 sSnackbarDurationMs = durationMs;
589 } 587 }
590 } 588 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698