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

Unified Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.cc

Issue 2250223002: Add InfoBar delegate for previews (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.cc
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.cc
index 1b05bacc1f65f61fd78a7d7cea9f282955aa24ab..82316c3ec3cb8a77667dff2a28f9b4dc55931058 100644
--- a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.cc
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.cc
@@ -11,6 +11,7 @@
#include "build/build_config.h"
#include "chrome/browser/net/spdyproxy/chrome_data_use_group_provider.h"
#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
+#include "chrome/browser/previews/previews_infobar_delegate.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/pref_names.h"
@@ -25,7 +26,6 @@
#if defined(OS_ANDROID)
#include "base/android/build_info.h"
-#include "chrome/browser/android/tab_android.h"
#endif
namespace content {
@@ -36,18 +36,11 @@ using data_reduction_proxy::DataReductionProxyParams;
namespace {
-// For Android builds, notifies the TabAndroid associated with |web_contents|
-// that a Lo-Fi response has been received. The TabAndroid then handles showing
-// Lo-Fi UI if this is the first Lo-Fi response for a page load. |is_preview|
-// indicates whether the response was a Lo-Fi preview response.
-void OnLoFiResponseReceivedOnUI(content::WebContents* web_contents,
- bool is_preview) {
+// If this is the first Lo-Fi response for a page load, a
+// PreviewsInfoBarDelegate is created, which handles showing Lo-Fi UI.
+void OnLoFiResponseReceivedOnUI(content::WebContents* web_contents) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-#if defined(OS_ANDROID)
- TabAndroid* tab = TabAndroid::FromWebContents(web_contents);
- if (tab)
- tab->OnLoFiResponseReceived(is_preview);
-#endif
+ PreviewsInfoBarDelegate::Create(web_contents, PreviewsInfoBarDelegate::LOFI);
}
} // namespace
« no previous file with comments | « chrome/browser/android/resource_id.h ('k') | chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698