| 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 ed1449a4bc6698c45b0f04ee0df70ea3ea539aa6..def66ab77c167be3725369df7a97e9faf3218eff 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
|
| @@ -6,19 +6,24 @@
|
|
|
| #include <utility>
|
|
|
| +#include "base/bind.h"
|
| #include "base/prefs/pref_service.h"
|
| #include "build/build_config.h"
|
| #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
|
| #include "chrome/common/chrome_content_client.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "components/data_reduction_proxy/content/browser/content_lofi_decider.h"
|
| +#include "components/data_reduction_proxy/content/browser/content_lofi_ui_service.h"
|
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config_retrieval_params.h"
|
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_experiments_stats.h"
|
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h"
|
| #include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
|
| +#include "content/public/browser/browser_thread.h"
|
| +#include "content/public/browser/web_contents.h"
|
|
|
| #if defined(OS_ANDROID)
|
| #include "base/android/build_info.h"
|
| +#include "chrome/browser/android/tab_android.h"
|
| #endif
|
|
|
| #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
|
| @@ -33,6 +38,22 @@ class BrowserContext;
|
|
|
| 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.
|
| +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();
|
| +#endif
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| scoped_ptr<data_reduction_proxy::DataReductionProxyIOData>
|
| CreateDataReductionProxyChromeIOData(
|
| net::NetLog* net_log,
|
| @@ -71,6 +92,10 @@ CreateDataReductionProxyChromeIOData(
|
|
|
| data_reduction_proxy_io_data->set_lofi_decider(
|
| make_scoped_ptr(new data_reduction_proxy::ContentLoFiDecider()));
|
| + data_reduction_proxy_io_data->set_lofi_ui_service(
|
| + make_scoped_ptr(new data_reduction_proxy::ContentLoFiUIService(
|
| + ui_task_runner,
|
| + base::Bind(&OnLoFiResponseReceivedOnUI))));
|
|
|
| #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
|
| scoped_ptr<data_reduction_proxy::ContentDataReductionProxyDebugUIService>
|
|
|