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

Unified Diff: chrome/browser/android/offline_pages/offline_page_tab_helper.cc

Issue 1980623003: Update offline pages UMAs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 4 years, 7 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/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 f818cf64c8cd76c578e390e6ca70bdb5b980c2f4..4d45c00bc08e03b1c4420ef2adca4a159849033b 100644
--- a/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
+++ b/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
@@ -89,6 +89,7 @@ void OfflinePageTabHelper::DidFinishNavigation(
if (error_code == net::OK &&
OfflinePageUtils::IsOfflinePage(
web_contents()->GetBrowserContext(), navigation_handle->GetURL())) {
+ UMA_HISTOGRAM_BOOLEAN("OfflinePages.ShowOfflinePageOnBadNetwork", true);
OfflinePageUtils::MarkPageAccessed(
web_contents()->GetBrowserContext(), navigation_handle->GetURL());
}
@@ -104,6 +105,7 @@ void OfflinePageTabHelper::DidFinishNavigation(
// On a forward or back transition, don't affect the order of the nav stack.
if (navigation_handle->GetPageTransition() ==
ui::PAGE_TRANSITION_FORWARD_BACK) {
+ UMA_HISTOGRAM_BOOLEAN("OfflinePages.ShowOfflinePageOnBadNetwork", false);
return;
}
@@ -114,8 +116,10 @@ void OfflinePageTabHelper::DidFinishNavigation(
// in this case.
GURL offline_url = offline_pages::OfflinePageUtils::GetOfflineURLForOnlineURL(
web_contents()->GetBrowserContext(), navigation_handle->GetURL());
- if (!offline_url.is_valid())
+ if (!offline_url.is_valid()) {
+ UMA_HISTOGRAM_BOOLEAN("OfflinePages.ShowOfflinePageOnBadNetwork", false);
return;
+ }
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
« no previous file with comments | « chrome/browser/android/offline_pages/offline_page_bridge.cc ('k') | components/offline_pages/offline_page_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698