| 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_NATIVE_AW_CONTENTS_IO_THREAD_CLIENT_IMPL_H_ | 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_IO_THREAD_CLIENT_IMPL_H_ |
| 6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_IO_THREAD_CLIENT_IMPL_H_ | 6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_IO_THREAD_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "android_webview/browser/aw_contents_io_thread_client.h" | 8 #include "android_webview/browser/aw_contents_io_thread_client.h" |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // Associates the |jclient| instance (which must implement the | 29 // Associates the |jclient| instance (which must implement the |
| 30 // AwContentsIoThreadClient Java interface) with the |web_contents|. | 30 // AwContentsIoThreadClient Java interface) with the |web_contents|. |
| 31 // This should be called at most once per |web_contents|. | 31 // This should be called at most once per |web_contents|. |
| 32 static void Associate(content::WebContents* web_contents, | 32 static void Associate(content::WebContents* web_contents, |
| 33 const base::android::JavaRef<jobject>& jclient); | 33 const base::android::JavaRef<jobject>& jclient); |
| 34 | 34 |
| 35 AwContentsIoThreadClientImpl(const base::android::JavaRef<jobject>& jclient); | 35 AwContentsIoThreadClientImpl(const base::android::JavaRef<jobject>& jclient); |
| 36 virtual ~AwContentsIoThreadClientImpl() OVERRIDE; | 36 virtual ~AwContentsIoThreadClientImpl() OVERRIDE; |
| 37 | 37 |
| 38 // Implementation of AwContentsIoThreadClient. | 38 // Implementation of AwContentsIoThreadClient. |
| 39 virtual CacheMode GetCacheMode() const OVERRIDE; |
| 39 virtual scoped_ptr<InterceptedRequestData> ShouldInterceptRequest( | 40 virtual scoped_ptr<InterceptedRequestData> ShouldInterceptRequest( |
| 40 const GURL& location, | 41 const GURL& location, |
| 41 const net::URLRequest* request) OVERRIDE; | 42 const net::URLRequest* request) OVERRIDE; |
| 42 virtual bool ShouldBlockContentUrls() const OVERRIDE; | 43 virtual bool ShouldBlockContentUrls() const OVERRIDE; |
| 43 virtual bool ShouldBlockFileUrls() const OVERRIDE; | 44 virtual bool ShouldBlockFileUrls() const OVERRIDE; |
| 44 virtual bool ShouldBlockNetworkLoads() const OVERRIDE; | 45 virtual bool ShouldBlockNetworkLoads() const OVERRIDE; |
| 45 | 46 |
| 46 private: | 47 private: |
| 47 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 48 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 48 | 49 |
| 49 DISALLOW_COPY_AND_ASSIGN(AwContentsIoThreadClientImpl); | 50 DISALLOW_COPY_AND_ASSIGN(AwContentsIoThreadClientImpl); |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 // JNI registration method. | 53 // JNI registration method. |
| 53 bool RegisterAwContentsIoThreadClientImpl(JNIEnv* env); | 54 bool RegisterAwContentsIoThreadClientImpl(JNIEnv* env); |
| 54 | 55 |
| 55 } // namespace android_webview | 56 } // namespace android_webview |
| 56 | 57 |
| 57 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_IO_THREAD_CLIENT_IMPL_H_ | 58 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_IO_THREAD_CLIENT_IMPL_H_ |
| OLD | NEW |