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

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

Issue 2245213002: Add PageLoad.* metrics for Offline Previews (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review Created 4 years, 4 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.h
diff --git a/chrome/browser/android/offline_pages/offline_page_tab_helper.h b/chrome/browser/android/offline_pages/offline_page_tab_helper.h
index 6bf460b072ceeafb3ef5662e8ecdf2edb6552e56..953e3936df37aeb6fd8d503cf15c1a0cf8e9c406 100644
--- a/chrome/browser/android/offline_pages/offline_page_tab_helper.h
+++ b/chrome/browser/android/offline_pages/offline_page_tab_helper.h
@@ -61,21 +61,24 @@ class OfflinePageTabHelper :
// Prohibitively slow means that the NetworkQualityEstimator reported a
// connection slow enough to warrant showing an offline page if available.
REDIRECTED_ON_PROHIBITIVELY_SLOW_NETWORK = 10,
PAGE_NOT_FOUND_ON_PROHIBITIVELY_SLOW_NETWORK = 11,
PAGE_NOT_FRESH_ON_PROHIBITIVELY_SLOW_NETWORK = 12,
REDIRECT_RESULT_MAX,
};
~OfflinePageTabHelper() override;
- const OfflinePageItem* offline_page() { return offline_page_.get(); }
+ const OfflinePageItem* offline_page() const { return offline_page_.get(); }
+
+ // Whether the page is an offline preview.
+ bool is_preview() const { return is_preview_; }
private:
friend class content::WebContentsUserData<OfflinePageTabHelper>;
friend class OfflinePageTabHelperTest;
FRIEND_TEST_ALL_PREFIXES(OfflinePageTabHelperTest,
NewNavigationCancelsPendingRedirects);
explicit OfflinePageTabHelper(content::WebContents* web_contents);
void SetDelegateForTesting(std::unique_ptr<Delegate> delegate);
@@ -110,18 +113,21 @@ class OfflinePageTabHelper :
bool IsInRedirectLoop(const GURL& to_url) const;
void ReportRedirectResultUMA(RedirectResult result);
// Iff the tab we are associated with is redirected to an offline page,
// |offline_page_| will be non-null. This can be used to synchronously ask
// about the offline state of the current web contents.
std::unique_ptr<OfflinePageItem> offline_page_;
std::unique_ptr<Delegate> delegate_;
+ // Whether the page is an offline preview.
tbansal1 2016/08/18 22:04:52 It might be useful to define what is an "offline p
tbansal1 2016/08/18 22:04:53 may be change to is_offline_preview_ (similar to v
RyanSturm 2016/08/19 19:10:38 Done.
RyanSturm 2016/08/19 19:10:38 Done.
+ bool is_preview_;
+
base::WeakPtrFactory<OfflinePageTabHelper> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(OfflinePageTabHelper);
};
} // namespace offline_pages
#endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698