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" |
(...skipping 17 matching lines...) Expand all Loading... |
28 // 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 |
29 // 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. |
30 class CONTENT_EXPORT IntentInjector : public TabContentsObserver { | 30 class CONTENT_EXPORT IntentInjector : public TabContentsObserver { |
31 public: | 31 public: |
32 // |tab_contents| must not be NULL. | 32 // |tab_contents| must not be NULL. |
33 explicit IntentInjector(TabContents* tab_contents); | 33 explicit IntentInjector(TabContents* tab_contents); |
34 virtual ~IntentInjector(); | 34 virtual ~IntentInjector(); |
35 | 35 |
36 // TabContentsObserver implementation. | 36 // TabContentsObserver implementation. |
37 virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; | 37 virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; |
38 virtual void DidNavigateMainFramePostCommit( | 38 virtual void DidNavigateMainFrame( |
39 const content::LoadCommittedDetails& details, | 39 const content::LoadCommittedDetails& details, |
40 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; | 40 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; |
41 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 41 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
42 virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE; | 42 virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE; |
43 | 43 |
44 // Used to notify the object that the source tab has been destroyed. | 44 // Used to notify the object that the source tab has been destroyed. |
45 virtual void SourceTabContentsDestroyed(TabContents* tab); | 45 virtual void SourceTabContentsDestroyed(TabContents* tab); |
46 | 46 |
47 // Sets the intent data to be injected. Call after the user has selected a | 47 // Sets the intent data to be injected. Call after the user has selected a |
48 // service to pass the intent data to that service. | 48 // service to pass the intent data to that service. |
(...skipping 22 matching lines...) Expand all Loading... |
71 // Message forwarder to the tab invoking the intent. | 71 // Message forwarder to the tab invoking the intent. |
72 scoped_ptr<IPC::Message::Sender> source_tab_; | 72 scoped_ptr<IPC::Message::Sender> source_tab_; |
73 | 73 |
74 // Unique ID assigned to the intent by the source tab. | 74 // Unique ID assigned to the intent by the source tab. |
75 int intent_id_; | 75 int intent_id_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(IntentInjector); | 77 DISALLOW_COPY_AND_ASSIGN(IntentInjector); |
78 }; | 78 }; |
79 | 79 |
80 #endif // CONTENT_BROWSER_INTENTS_INTENT_INJECTOR_H_ | 80 #endif // CONTENT_BROWSER_INTENTS_INTENT_INJECTOR_H_ |
OLD | NEW |