| Index: chrome/browser/android/offline_pages/offline_page_tab_helper.cc
|
| diff --git a/chrome/browser/android/offline_pages/offline_page_tab_helper.cc b/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
|
| index 3d064bdb51451a42f92d9653bf238c7aa8f20978..6f43b9f55c2dc9dfd29842672c62fa0f8f68c5eb 100644
|
| --- a/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
|
| +++ b/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
|
| @@ -9,6 +9,8 @@
|
| #include "base/metrics/histogram.h"
|
| #include "base/threading/thread_task_runner_handle.h"
|
| #include "chrome/browser/android/offline_pages/offline_page_utils.h"
|
| +#include "chrome/browser/browser_process.h"
|
| +#include "components/rappor/rappor_utils.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/navigation_controller.h"
|
| #include "content/public/browser/navigation_entry.h"
|
| @@ -107,16 +109,22 @@ void OfflinePageTabHelper::DidFinishNavigation(
|
| return;
|
| }
|
|
|
| + GURL online_url = navigation_handle->GetURL();
|
| +
|
| // When the navigation starts, we redirect immediately from online page to
|
| // offline version on the case that there is no network connection. If there
|
| // is still network connection but with no or poor network connectivity, the
|
| // navigation will eventually fail and we want to redirect to offline copy
|
| // in this case.
|
| GURL offline_url = offline_pages::OfflinePageUtils::GetOfflineURLForOnlineURL(
|
| - web_contents()->GetBrowserContext(), navigation_handle->GetURL());
|
| + web_contents()->GetBrowserContext(), online_url);
|
| if (!offline_url.is_valid())
|
| return;
|
|
|
| + rappor::SampleDomainAndRegistryFromGURL(
|
| + g_browser_process->rappor_service(),
|
| + "OfflinePages.OfflineVersionWasViewedWhileOffline", online_url);
|
| +
|
| base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| FROM_HERE,
|
| base::Bind(&OfflinePageTabHelper::Redirect,
|
|
|