| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 | 11 |
| 12 class GURL; | 12 class GURL; |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 class URLRequest; | 15 class URLRequest; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace android_webview { | 18 namespace android_webview { |
| 19 | 19 |
| 20 class InterceptedRequestData; | 20 class AwWebResourceResponse; |
| 21 | 21 |
| 22 // This class provides a means of calling Java methods on an instance that has | 22 // This class provides a means of calling Java methods on an instance that has |
| 23 // a 1:1 relationship with a WebContents instance directly from the IO thread. | 23 // a 1:1 relationship with a WebContents instance directly from the IO thread. |
| 24 // | 24 // |
| 25 // Specifically this is used to associate URLRequests with the WebContents that | 25 // Specifically this is used to associate URLRequests with the WebContents that |
| 26 // the URLRequest is made for. | 26 // the URLRequest is made for. |
| 27 // | 27 // |
| 28 // The native class is intended to be a short-lived handle that pins the | 28 // The native class is intended to be a short-lived handle that pins the |
| 29 // Java-side instance. It is preferable to use the static getter methods to | 29 // Java-side instance. It is preferable to use the static getter methods to |
| 30 // obtain a new instance of the class rather than holding on to one for | 30 // obtain a new instance of the class rather than holding on to one for |
| (...skipping 30 matching lines...) Expand all Loading... |
| 61 // An empty scoped_ptr is a valid return value. | 61 // An empty scoped_ptr is a valid return value. |
| 62 static scoped_ptr<AwContentsIoThreadClient> FromID(int render_process_id, | 62 static scoped_ptr<AwContentsIoThreadClient> FromID(int render_process_id, |
| 63 int render_frame_id); | 63 int render_frame_id); |
| 64 | 64 |
| 65 // Called on the IO thread when a subframe is created. | 65 // Called on the IO thread when a subframe is created. |
| 66 static void SubFrameCreated(int render_process_id, | 66 static void SubFrameCreated(int render_process_id, |
| 67 int parent_render_frame_id, | 67 int parent_render_frame_id, |
| 68 int child_render_frame_id); | 68 int child_render_frame_id); |
| 69 | 69 |
| 70 // This method is called on the IO thread only. | 70 // This method is called on the IO thread only. |
| 71 virtual scoped_ptr<InterceptedRequestData> ShouldInterceptRequest( | 71 virtual scoped_ptr<AwWebResourceResponse> ShouldInterceptRequest( |
| 72 const GURL& location, | 72 const GURL& location, |
| 73 const net::URLRequest* request) = 0; | 73 const net::URLRequest* request) = 0; |
| 74 | 74 |
| 75 // Retrieve the AllowContentAccess setting value of this AwContents. | 75 // Retrieve the AllowContentAccess setting value of this AwContents. |
| 76 // This method is called on the IO thread only. | 76 // This method is called on the IO thread only. |
| 77 virtual bool ShouldBlockContentUrls() const = 0; | 77 virtual bool ShouldBlockContentUrls() const = 0; |
| 78 | 78 |
| 79 // Retrieve the AllowFileAccess setting value of this AwContents. | 79 // Retrieve the AllowFileAccess setting value of this AwContents. |
| 80 // This method is called on the IO thread only. | 80 // This method is called on the IO thread only. |
| 81 virtual bool ShouldBlockFileUrls() const = 0; | 81 virtual bool ShouldBlockFileUrls() const = 0; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 100 // WebViewClient.onReceivedLoginRequest for arguments. Note that |account| | 100 // WebViewClient.onReceivedLoginRequest for arguments. Note that |account| |
| 101 // may be empty. | 101 // may be empty. |
| 102 virtual void NewLoginRequest(const std::string& realm, | 102 virtual void NewLoginRequest(const std::string& realm, |
| 103 const std::string& account, | 103 const std::string& account, |
| 104 const std::string& args) = 0; | 104 const std::string& args) = 0; |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace android_webview | 107 } // namespace android_webview |
| 108 | 108 |
| 109 #endif // ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ | 109 #endif // ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ |
| OLD | NEW |