| 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_BROWSER_INTENTS_INTENT_INJECTOR_H_ | 5 #ifndef CONTENT_BROWSER_INTENTS_INTENT_INJECTOR_H_ |
| 6 #define CONTENT_BROWSER_INTENTS_INTENT_INJECTOR_H_ | 6 #define CONTENT_BROWSER_INTENTS_INTENT_INJECTOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // RenderView is created. It will then send the intent data down to the renderer | 31 // RenderView is created. It will then send the intent data down to the renderer |
| 32 // on the RenderViewCreated call, so that the intent data is available | 32 // on the RenderViewCreated call, so that the intent data is available |
| 33 // throughout the parsing of the loaded document. | 33 // throughout the parsing of the loaded document. |
| 34 class CONTENT_EXPORT IntentInjector : public content::WebContentsObserver { | 34 class CONTENT_EXPORT IntentInjector : public content::WebContentsObserver { |
| 35 public: | 35 public: |
| 36 // |web_contents| must not be NULL. | 36 // |web_contents| must not be NULL. |
| 37 explicit IntentInjector(content::WebContents* web_contents); | 37 explicit IntentInjector(content::WebContents* web_contents); |
| 38 virtual ~IntentInjector(); | 38 virtual ~IntentInjector(); |
| 39 | 39 |
| 40 // content::WebContentsObserver implementation. | 40 // content::WebContentsObserver implementation. |
| 41 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; | 41 virtual void RenderViewCreated( |
| 42 content::RenderViewHost* render_view_host) OVERRIDE; |
| 42 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 43 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 43 virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE; | 44 virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE; |
| 44 | 45 |
| 45 // Used to notify the object that the source tab has been destroyed. | 46 // Used to notify the object that the source tab has been destroyed. |
| 46 void SourceWebContentsDestroyed(content::WebContents* tab); | 47 void SourceWebContentsDestroyed(content::WebContents* tab); |
| 47 | 48 |
| 48 // Sets the intent data to be injected. Call after the user has selected a | 49 // Sets the intent data to be injected. Call after the user has selected a |
| 49 // service to pass the intent data to that service. | 50 // service to pass the intent data to that service. |
| 50 // |intents_dispatcher| is a sender to use to communicate to the source tab. | 51 // |intents_dispatcher| is a sender to use to communicate to the source tab. |
| 51 // The caller must ensure that SourceTabContentsDestroyed is called when this | 52 // The caller must ensure that SourceTabContentsDestroyed is called when this |
| (...skipping 13 matching lines...) Expand all Loading... |
| 65 // Source intent data provided by caller. | 66 // Source intent data provided by caller. |
| 66 scoped_ptr<webkit_glue::WebIntentData> source_intent_; | 67 scoped_ptr<webkit_glue::WebIntentData> source_intent_; |
| 67 | 68 |
| 68 // Weak pointer to the message forwarder to the tab invoking the intent. | 69 // Weak pointer to the message forwarder to the tab invoking the intent. |
| 69 content::WebIntentsDispatcher* intents_dispatcher_; | 70 content::WebIntentsDispatcher* intents_dispatcher_; |
| 70 | 71 |
| 71 DISALLOW_COPY_AND_ASSIGN(IntentInjector); | 72 DISALLOW_COPY_AND_ASSIGN(IntentInjector); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 #endif // CONTENT_BROWSER_INTENTS_INTENT_INJECTOR_H_ | 75 #endif // CONTENT_BROWSER_INTENTS_INTENT_INJECTOR_H_ |
| OLD | NEW |