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

Side by Side Diff: chrome/browser/android/offline_pages/offline_page_tab_helper.h

Issue 1721103002: Switch between online and offline version per network connection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch Created 4 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_
7
8 #include "base/macros.h"
9 #include "content/public/browser/web_contents_observer.h"
10 #include "content/public/browser/web_contents_user_data.h"
11
12 namespace content {
13 class RenderFrameHost;
14 }
15
16 // Per-tab class to manage switch between online version and offline version.
17 class OfflinePageTabHelper :
18 public content::WebContentsObserver,
19 public content::WebContentsUserData<OfflinePageTabHelper> {
20 public:
21 ~OfflinePageTabHelper() override;
22
23 private:
24 friend class content::WebContentsUserData<OfflinePageTabHelper>;
25
26 explicit OfflinePageTabHelper(content::WebContents* web_contents);
27
28 // Overridden from content::WebContentsObserver:
29 void DidStartProvisionalLoadForFrame(
30 content::RenderFrameHost* render_frame_host,
31 const GURL& validated_url,
32 bool is_error_page,
33 bool is_iframe_srcdoc) override;
34 void DidFailProvisionalLoad(content::RenderFrameHost* render_frame_host,
35 const GURL& validated_url,
36 int error_code,
37 const base::string16& error_description,
38 bool was_ignored_by_handler) override;
39
40 DISALLOW_COPY_AND_ASSIGN(OfflinePageTabHelper);
41 };
42
43 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_TAB_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698