| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INTENTS_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_INTENTS_DISPATCHER_H_ |
| 6 #define CONTENT_RENDERER_INTENTS_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_INTENTS_DISPATCHER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.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/WebString.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
| 12 #include "webkit/glue/web_intent_data.h" | 12 #include "webkit/glue/web_intent_data.h" |
| 13 #include "webkit/glue/web_intent_reply_data.h" | 13 #include "webkit/glue/web_intent_reply_data.h" |
| 14 | 14 |
| 15 namespace webkit_glue { | 15 class RenderViewImpl; |
| 16 struct WebIntentData; | |
| 17 } | |
| 18 | 16 |
| 19 namespace WebKit { | 17 namespace WebKit { |
| 20 class WebFrame; | 18 class WebFrame; |
| 21 } | 19 } |
| 22 | 20 |
| 21 namespace webkit_glue { |
| 22 struct WebIntentData; |
| 23 } |
| 24 |
| 23 // IntentsDispatcher is a delegate for Web Intents messages. It is the | 25 // IntentsDispatcher is a delegate for Web Intents messages. It is the |
| 24 // renderer-side handler for IPC messages delivering the intent payload data | 26 // renderer-side handler for IPC messages delivering the intent payload data |
| 25 // and preparing it for access by the service page. | 27 // and preparing it for access by the service page. |
| 26 class IntentsDispatcher : public content::RenderViewObserver { | 28 class IntentsDispatcher : public content::RenderViewObserver { |
| 27 public: | 29 public: |
| 28 // |render_view| must not be NULL. | 30 // |render_view| must not be NULL. |
| 29 explicit IntentsDispatcher(RenderView* render_view); | 31 explicit IntentsDispatcher(RenderViewImpl* render_view); |
| 30 virtual ~IntentsDispatcher(); | 32 virtual ~IntentsDispatcher(); |
| 31 | 33 |
| 32 // Called by the bound intent object to register the result from the service | 34 // Called by the bound intent object to register the result from the service |
| 33 // page. | 35 // page. |
| 34 void OnResult(const WebKit::WebString& data); | 36 void OnResult(const WebKit::WebString& data); |
| 35 void OnFailure(const WebKit::WebString& data); | 37 void OnFailure(const WebKit::WebString& data); |
| 36 | 38 |
| 37 private: | 39 private: |
| 38 class BoundDeliveredIntent; | 40 class BoundDeliveredIntent; |
| 39 | 41 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 60 int intent_id_; | 62 int intent_id_; |
| 61 | 63 |
| 62 // Representation of the intent data as a C++ bound NPAPI object to be | 64 // Representation of the intent data as a C++ bound NPAPI object to be |
| 63 // injected into the Javascript context. | 65 // injected into the Javascript context. |
| 64 scoped_ptr<BoundDeliveredIntent> delivered_intent_; | 66 scoped_ptr<BoundDeliveredIntent> delivered_intent_; |
| 65 | 67 |
| 66 DISALLOW_COPY_AND_ASSIGN(IntentsDispatcher); | 68 DISALLOW_COPY_AND_ASSIGN(IntentsDispatcher); |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 #endif // CONTENT_RENDERER_INTENTS_DISPATCHER_H_ | 71 #endif // CONTENT_RENDERER_INTENTS_DISPATCHER_H_ |
| OLD | NEW |