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 CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 public NotificationObserver { | 49 public NotificationObserver { |
50 public: | 50 public: |
51 // A messaging channel. Note that the opening port can be the same as the | 51 // A messaging channel. Note that the opening port can be the same as the |
52 // receiver, if an extension toolstrip wants to talk to its tab (for example). | 52 // receiver, if an extension toolstrip wants to talk to its tab (for example). |
53 struct MessageChannel; | 53 struct MessageChannel; |
54 struct MessagePort; | 54 struct MessagePort; |
55 | 55 |
56 // Javascript function name constants. | 56 // Javascript function name constants. |
57 static const char kDispatchOnConnect[]; | 57 static const char kDispatchOnConnect[]; |
58 static const char kDispatchOnDisconnect[]; | 58 static const char kDispatchOnDisconnect[]; |
59 static const char kDispatchOnMessage[]; | |
60 | 59 |
61 // Allocates a pair of port ids. | 60 // Allocates a pair of port ids. |
62 // NOTE: this can be called from any thread. | 61 // NOTE: this can be called from any thread. |
63 static void AllocatePortIdPair(int* port1, int* port2); | 62 static void AllocatePortIdPair(int* port1, int* port2); |
64 | 63 |
65 explicit ExtensionMessageService(Profile* profile); | 64 explicit ExtensionMessageService(Profile* profile); |
66 | 65 |
67 // Notification that our owning profile is going away. | 66 // Notification that our owning profile is going away. |
68 void DestroyingProfile(); | 67 void DestroyingProfile(); |
69 | 68 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 Profile* profile_; | 144 Profile* profile_; |
146 | 145 |
147 NotificationRegistrar registrar_; | 146 NotificationRegistrar registrar_; |
148 | 147 |
149 MessageChannelMap channels_; | 148 MessageChannelMap channels_; |
150 | 149 |
151 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageService); | 150 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageService); |
152 }; | 151 }; |
153 | 152 |
154 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ | 153 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_SERVICE_H_ |
OLD | NEW |