| 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 CONTENT_RENDERER_WEB_INTENTS_HOST_H_ | 5 #ifndef CONTENT_RENDERER_WEB_INTENTS_HOST_H_ |
| 6 #define CONTENT_RENDERER_WEB_INTENTS_HOST_H_ | 6 #define CONTENT_RENDERER_WEB_INTENTS_HOST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/public/renderer/render_view_observer.h" | 11 #include "content/public/renderer/render_view_observer.h" |
| 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlob.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlob.h" |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntent.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntent.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 15 #include "v8/include/v8.h" | 15 #include "v8/include/v8.h" |
| 16 #include "webkit/glue/web_intent_data.h" | 16 #include "webkit/glue/web_intent_data.h" |
| 17 #include "webkit/glue/web_intent_reply_data.h" | 17 #include "webkit/glue/web_intent_reply_data.h" |
| 18 | 18 |
| 19 class RenderViewImpl; | |
| 20 | |
| 21 namespace WebKit { | 19 namespace WebKit { |
| 22 class WebDeliveredIntentClient; | 20 class WebDeliveredIntentClient; |
| 23 class WebIntentRequest; | 21 class WebIntentRequest; |
| 24 class WebFrame; | 22 class WebFrame; |
| 25 } | 23 } |
| 26 | 24 |
| 27 namespace webkit_glue { | 25 namespace webkit_glue { |
| 28 struct WebIntentData; | 26 struct WebIntentData; |
| 29 } | 27 } |
| 30 | 28 |
| 29 namespace content { |
| 30 class RenderViewImpl; |
| 31 |
| 31 // WebIntentsHost is a delegate for Web Intents messages. It is the | 32 // WebIntentsHost is a delegate for Web Intents messages. It is the |
| 32 // renderer-side handler for IPC messages delivering the intent payload data | 33 // renderer-side handler for IPC messages delivering the intent payload data |
| 33 // and preparing it for access by the service page. | 34 // and preparing it for access by the service page. |
| 34 class WebIntentsHost : public content::RenderViewObserver { | 35 class WebIntentsHost : public RenderViewObserver { |
| 35 public: | 36 public: |
| 36 // |render_view| must not be NULL. | 37 // |render_view| must not be NULL. |
| 37 explicit WebIntentsHost(RenderViewImpl* render_view); | 38 explicit WebIntentsHost(RenderViewImpl* render_view); |
| 38 virtual ~WebIntentsHost(); | 39 virtual ~WebIntentsHost(); |
| 39 | 40 |
| 40 // Called by the RenderView to register a new Web Intent invocation. | 41 // Called by the RenderView to register a new Web Intent invocation. |
| 41 int RegisterWebIntent(const WebKit::WebIntentRequest& request); | 42 int RegisterWebIntent(const WebKit::WebIntentRequest& request); |
| 42 | 43 |
| 43 // Called into when the delivered intent object gets a postResult call. | 44 // Called into when the delivered intent object gets a postResult call. |
| 44 void OnResult(const WebKit::WebString& data); | 45 void OnResult(const WebKit::WebString& data); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // delivered intent. | 91 // delivered intent. |
| 91 scoped_ptr<WebKit::WebDeliveredIntentClient> delivered_intent_client_; | 92 scoped_ptr<WebKit::WebDeliveredIntentClient> delivered_intent_client_; |
| 92 | 93 |
| 93 // If we deliver a browser-originated blob intent to the client, | 94 // If we deliver a browser-originated blob intent to the client, |
| 94 // this is that Blob. | 95 // this is that Blob. |
| 95 WebKit::WebBlob web_blob_; | 96 WebKit::WebBlob web_blob_; |
| 96 | 97 |
| 97 DISALLOW_COPY_AND_ASSIGN(WebIntentsHost); | 98 DISALLOW_COPY_AND_ASSIGN(WebIntentsHost); |
| 98 }; | 99 }; |
| 99 | 100 |
| 101 } // namespace content |
| 102 |
| 100 #endif // CONTENT_RENDERER_WEB_INTENTS_HOST_H_ | 103 #endif // CONTENT_RENDERER_WEB_INTENTS_HOST_H_ |
| OLD | NEW |