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_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/string16.h" | 10 #include "base/string16.h" |
11 #include "content/browser/tab_contents/tab_contents_observer.h" | 11 #include "content/browser/tab_contents/tab_contents_observer.h" |
| 12 #include "content/common/content_export.h" |
12 #include "content/common/intents_messages.h" | 13 #include "content/common/intents_messages.h" |
13 | 14 |
14 class RenderViewHost; | 15 class RenderViewHost; |
15 class TabContents; | 16 class TabContents; |
16 | 17 |
17 namespace webkit_glue { | 18 namespace webkit_glue { |
18 struct WebIntentData; | 19 struct WebIntentData; |
19 } | 20 } |
20 | 21 |
21 namespace IPC { | 22 namespace IPC { |
22 class Message; | 23 class Message; |
23 } | 24 } |
24 | 25 |
25 // Injects an intent into the renderer of a TabContents. The intent dispatch | 26 // Injects an intent into the renderer of a TabContents. The intent dispatch |
26 // logic will create one of these to take care of passing intent data down into | 27 // logic will create one of these to take care of passing intent data down into |
27 // the context of the service, which will be running in the TabContents on which | 28 // the context of the service, which will be running in the TabContents on which |
28 // this class is an observer. Deletes itself when the tab is closed. | 29 // this class is an observer. Deletes itself when the tab is closed. |
29 class IntentInjector : public TabContentsObserver { | 30 class CONTENT_EXPORT IntentInjector : public TabContentsObserver { |
30 public: | 31 public: |
31 // |tab_contents| must not be NULL. | 32 // |tab_contents| must not be NULL. |
32 explicit IntentInjector(TabContents* tab_contents); | 33 explicit IntentInjector(TabContents* tab_contents); |
33 virtual ~IntentInjector(); | 34 virtual ~IntentInjector(); |
34 | 35 |
35 // TabContentsObserver implementation. | 36 // TabContentsObserver implementation. |
36 virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; | 37 virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; |
37 virtual void DidNavigateMainFramePostCommit( | 38 virtual void DidNavigateMainFramePostCommit( |
38 const content::LoadCommittedDetails& details, | 39 const content::LoadCommittedDetails& details, |
39 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; | 40 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; |
(...skipping 18 matching lines...) Expand all Loading... |
58 | 59 |
59 // Source intent data provided by caller. | 60 // Source intent data provided by caller. |
60 scoped_ptr<webkit_glue::WebIntentData> source_intent_; | 61 scoped_ptr<webkit_glue::WebIntentData> source_intent_; |
61 int source_routing_id_; | 62 int source_routing_id_; |
62 int intent_id_; | 63 int intent_id_; |
63 | 64 |
64 DISALLOW_COPY_AND_ASSIGN(IntentInjector); | 65 DISALLOW_COPY_AND_ASSIGN(IntentInjector); |
65 }; | 66 }; |
66 | 67 |
67 #endif // CONTENT_BROWSER_INTENTS_INTENT_INJECTOR_H_ | 68 #endif // CONTENT_BROWSER_INTENTS_INTENT_INJECTOR_H_ |
OLD | NEW |