| OLD | NEW |
| (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_ |
| OLD | NEW |