Commit 7a40c625 authored by gambard's avatar gambard Committed by Commit bot

Add histogram for Online/Offline Reading List display

This CL records if the Reading List entry is displayed as the online or
offline version.

BUG=651041

Review-Url: https://codereview.chromium.org/2570463006
Cr-Commit-Position: refs/heads/master@{#440743}
parent ba53250c
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "components/reading_list/ios/reading_list_model.h" #include "components/reading_list/ios/reading_list_model.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/browser/chrome_url_constants.h"
...@@ -200,6 +201,7 @@ void ReadingListWebStateObserver::PageLoaded( ...@@ -200,6 +201,7 @@ void ReadingListWebStateObserver::PageLoaded(
if (load_completion_status == web::PageLoadCompletionStatus::SUCCESS) { if (load_completion_status == web::PageLoadCompletionStatus::SUCCESS) {
reading_list_model_->SetReadStatus(pending_url_, true); reading_list_model_->SetReadStatus(pending_url_, true);
UMA_HISTOGRAM_BOOLEAN("ReadingList.OfflineVersionDisplayed", false);
} else { } else {
LoadOfflineReadingListEntry(item); LoadOfflineReadingListEntry(item);
} }
...@@ -272,4 +274,5 @@ void ReadingListWebStateObserver::LoadOfflineReadingListEntry( ...@@ -272,4 +274,5 @@ void ReadingListWebStateObserver::LoadOfflineReadingListEntry(
item->SetVirtualURL(pending_url_); item->SetVirtualURL(pending_url_);
web_state()->GetNavigationManager()->Reload(false); web_state()->GetNavigationManager()->Reload(false);
reading_list_model_->SetReadStatus(entry->URL(), true); reading_list_model_->SetReadStatus(entry->URL(), true);
UMA_HISTOGRAM_BOOLEAN("ReadingList.OfflineVersionDisplayed", true);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment