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_RENDERER_AW_RENDER_VIEW_EXT_H_ | 5 #ifndef ANDROID_WEBVIEW_RENDERER_AW_RENDER_VIEW_EXT_H_ |
6 #define ANDROID_WEBVIEW_RENDERER_AW_RENDER_VIEW_EXT_H_ | 6 #define ANDROID_WEBVIEW_RENDERER_AW_RENDER_VIEW_EXT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "content/public/renderer/render_view_observer.h" | 10 #include "content/public/renderer/render_view_observer.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPermissionClient.h
" |
| 12 |
| 13 namespace WebKit { |
| 14 |
| 15 class WebURL; |
| 16 |
| 17 } // namespace WebKit |
11 | 18 |
12 namespace android_webview { | 19 namespace android_webview { |
13 | 20 |
14 // Render process side of AwRenderViewHostExt, this provides cross-process | 21 // Render process side of AwRenderViewHostExt, this provides cross-process |
15 // implementation of miscellaneous WebView functions that we need to poke | 22 // implementation of miscellaneous WebView functions that we need to poke |
16 // WebKit directly to implement (and that aren't needed in the chrome app). | 23 // WebKit directly to implement (and that aren't needed in the chrome app). |
17 class AwRenderViewExt : public content::RenderViewObserver { | 24 class AwRenderViewExt : public content::RenderViewObserver, |
| 25 public WebKit::WebPermissionClient { |
18 public: | 26 public: |
19 static void RenderViewCreated(content::RenderView* render_view); | 27 static void RenderViewCreated(content::RenderView* render_view); |
20 | 28 |
21 private: | 29 private: |
22 AwRenderViewExt(content::RenderView* render_view); | 30 AwRenderViewExt(content::RenderView* render_view); |
23 virtual ~AwRenderViewExt(); | 31 virtual ~AwRenderViewExt(); |
24 | 32 |
25 // RenderView::Observer: | 33 // RenderView::Observer: |
26 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 34 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
27 | 35 |
28 void OnDocumentHasImagesRequest(int id); | 36 void OnDocumentHasImagesRequest(int id); |
29 | 37 |
| 38 // WebKit::WebPermissionClient implementation. |
| 39 virtual bool allowImage(WebKit::WebFrame* frame, |
| 40 bool enabledPerSettings, |
| 41 const WebKit::WebURL& imageURL); |
| 42 |
30 DISALLOW_COPY_AND_ASSIGN(AwRenderViewExt); | 43 DISALLOW_COPY_AND_ASSIGN(AwRenderViewExt); |
31 }; | 44 }; |
32 | 45 |
33 } // namespace android_webview | 46 } // namespace android_webview |
34 | 47 |
35 #endif // ANDROID_WEBVIEW_RENDERER_AW_RENDER_VIEW_EXT_H_ | 48 #endif // ANDROID_WEBVIEW_RENDERER_AW_RENDER_VIEW_EXT_H_ |
OLD | NEW |