| Index: components/data_reduction_proxy/content/browser/data_reduction_proxy_ui_manager.cc
|
| diff --git a/components/data_reduction_proxy/content/browser/data_reduction_proxy_ui_manager.cc b/components/data_reduction_proxy/content/browser/data_reduction_proxy_ui_manager.cc
|
| index 987492d9bedf14d3a0b02723b3e885c7d2dfcae1..733c6d5ddb2cf6510af9cd0d479e5b04863597fc 100644
|
| --- a/components/data_reduction_proxy/content/browser/data_reduction_proxy_ui_manager.cc
|
| +++ b/components/data_reduction_proxy/content/browser/data_reduction_proxy_ui_manager.cc
|
| @@ -8,6 +8,7 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/time/time.h"
|
| +#include "components/data_reduction_proxy/content/browser/data_reduction_proxy_blocking_page.h"
|
| #include "content/public/browser/render_view_host.h"
|
| #include "content/public/browser/web_contents.h"
|
|
|
| @@ -70,26 +71,34 @@ void DataReductionProxyUIManager::DisplayBlockingPage(
|
| if (IsTabClosed(resource)) {
|
| // The tab is gone and there was not a chance to show the interstitial.
|
| // Just act as if "Don't Proceed" were chosen.
|
| + std::vector<BypassResource> resources;
|
| + resources.push_back(resource);
|
| io_task_runner_->PostTask(
|
| FROM_HERE,
|
| base::Bind(&DataReductionProxyUIManager::OnBlockingPageDone,
|
| - this, resource, false));
|
| + this, resources, false));
|
| return;
|
| }
|
|
|
| - // TODO(megjablon): Show blocking page. For now, continue on to the page.
|
| - io_task_runner_->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&DataReductionProxyUIManager::OnBlockingPageDone,
|
| - this, resource, true));
|
| + ShowBlockingPage(resource);
|
| +}
|
| +
|
| +void DataReductionProxyUIManager::ShowBlockingPage(
|
| + const BypassResource& resource) {
|
| + DataReductionProxyBlockingPage::ShowBlockingPage(
|
| + this, io_task_runner_, resource);
|
| }
|
|
|
| void DataReductionProxyUIManager::OnBlockingPageDone(
|
| - const BypassResource& resource,
|
| + const std::vector<BypassResource>& resources,
|
| bool proceed) {
|
| DCHECK(io_task_runner_->BelongsToCurrentThread());
|
| - if (!resource.callback.is_null())
|
| - resource.callback.Run(proceed);
|
| + for (std::vector<BypassResource>::const_iterator iter = resources.begin();
|
| + iter != resources.end(); ++iter) {
|
| + const BypassResource& resource = *iter;
|
| + if (!resource.callback.is_null())
|
| + resource.callback.Run(proceed);
|
| + }
|
| if (proceed)
|
| blocking_page_last_shown_ = base::Time::Now();
|
| }
|
|
|