OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_RENDERER_HOST_OFFLINE_RESOURCE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_OFFLINE_RESOURCE_HANDLER_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_OFFLINE_RESOURCE_HANDLER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_OFFLINE_RESOURCE_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 virtual bool OnReadCompleted(int request_id, int* bytes_read) OVERRIDE; | 45 virtual bool OnReadCompleted(int request_id, int* bytes_read) OVERRIDE; |
46 virtual bool OnResponseCompleted(int request_id, | 46 virtual bool OnResponseCompleted(int request_id, |
47 const net::URLRequestStatus& status, | 47 const net::URLRequestStatus& status, |
48 const std::string& security_info) OVERRIDE; | 48 const std::string& security_info) OVERRIDE; |
49 virtual void OnRequestClosed() OVERRIDE; | 49 virtual void OnRequestClosed() OVERRIDE; |
50 | 50 |
51 // OfflineLoadPage callback. | 51 // OfflineLoadPage callback. |
52 void OnBlockingPageComplete(bool proceed); | 52 void OnBlockingPageComplete(bool proceed); |
53 | 53 |
54 private: | 54 private: |
55 // Erase the state assocaited with a deferred load request. | 55 // Erase the state associated with a deferred load request. |
56 void ClearRequestInfo(); | 56 void ClearRequestInfo(); |
57 bool IsRemote(const GURL& url) const; | 57 bool IsRemote(const GURL& url) const; |
58 | 58 |
59 // Resume the deferred load request. | 59 // Resume the deferred load request. |
60 void Resume(); | 60 void Resume(); |
61 | 61 |
62 // True if chrome should show the offline page. | 62 // True if chrome should show the offline page. |
63 bool ShouldShowOfflinePage(const GURL& url) const; | 63 bool ShouldShowOfflinePage(const GURL& url) const; |
64 | 64 |
65 // Shows the offline interstitial page on the UI thread. | 65 // Shows the offline interstitial page on the UI thread. |
66 void ShowOfflinePage(); | 66 void ShowOfflinePage(); |
67 | 67 |
68 // A callback to tell if an appcache exists. | 68 // A callback to tell if an appcache exists. |
69 void OnCanHandleOfflineComplete(int rv); | 69 void OnCanHandleOfflineComplete(int rv); |
70 | 70 |
71 scoped_refptr<ResourceHandler> next_handler_; | 71 scoped_refptr<ResourceHandler> next_handler_; |
72 | 72 |
73 int process_host_id_; | 73 int process_host_id_; |
74 int render_view_id_; | 74 int render_view_id_; |
75 ResourceDispatcherHost* rdh_; | 75 ResourceDispatcherHost* rdh_; |
76 net::URLRequest* request_; | 76 net::URLRequest* request_; |
77 ChromeAppCacheService* const appcache_service_; | 77 ChromeAppCacheService* const appcache_service_; |
78 | 78 |
79 // The state for deferred load quest. | 79 // The state for deferred load quest. |
80 int deferred_request_id_; | 80 int deferred_request_id_; |
81 GURL deferred_url_; | 81 GURL deferred_url_; |
82 | 82 |
83 scoped_refptr<net::CancelableOldCompletionCallback<OfflineResourceHandler> > | 83 net::CancelableCompletionCallback appcache_completion_callback_; |
84 appcache_completion_callback_; | |
85 | 84 |
86 DISALLOW_COPY_AND_ASSIGN(OfflineResourceHandler); | 85 DISALLOW_COPY_AND_ASSIGN(OfflineResourceHandler); |
87 }; | 86 }; |
88 | 87 |
89 #endif // CHROME_BROWSER_RENDERER_HOST_OFFLINE_RESOURCE_HANDLER_H_ | 88 #endif // CHROME_BROWSER_RENDERER_HOST_OFFLINE_RESOURCE_HANDLER_H_ |
OLD | NEW |