1 // Copyright 2014 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.
5 #ifndef ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_
6 #define ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_
8 #include "android_webview/browser/aw_web_resource_response.h"
9 #include "base/android/scoped_java_ref.h"
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
14 class HttpResponseHeaders
;
17 namespace android_webview
{
21 class AwWebResourceResponseImpl
: public AwWebResourceResponse
{
23 // It is expected that |obj| is an instance of the Java-side
24 // org.chromium.android_webview.AwWebResourceResponse class.
25 AwWebResourceResponseImpl(const base::android::JavaRef
<jobject
>& obj
);
26 virtual ~AwWebResourceResponseImpl();
28 virtual scoped_ptr
<InputStream
> GetInputStream(JNIEnv
* env
) const OVERRIDE
;
29 virtual bool GetMimeType(JNIEnv
* env
, std::string
* mime_type
) const OVERRIDE
;
30 virtual bool GetCharset(JNIEnv
* env
, std::string
* charset
) const OVERRIDE
;
31 virtual bool GetStatusInfo(JNIEnv
* env
,
33 std::string
* reason_phrase
) const OVERRIDE
;
34 virtual bool GetResponseHeaders(
36 net::HttpResponseHeaders
* headers
) const OVERRIDE
;
39 base::android::ScopedJavaGlobalRef
<jobject
> java_object_
;
41 DISALLOW_COPY_AND_ASSIGN(AwWebResourceResponseImpl
);
44 bool RegisterAwWebResourceResponse(JNIEnv
* env
);
46 } // namespace android_webview
48 #endif // ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_