OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // A BrowserPluginGuestManager serves as a message router to BrowserPluginGuests | 5 // A BrowserPluginGuestManager serves as a message router to BrowserPluginGuests |
6 // for all guests within a given profile. | 6 // for all guests within a given profile. |
7 // Messages are routed to a particular guest instance based on an instance_id. | 7 // Messages are routed to a particular guest instance based on an instance_id. |
8 | 8 |
9 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ | 9 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ |
10 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ | 10 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ |
(...skipping 19 matching lines...) Expand all Loading... | |
30 | 30 |
31 namespace content { | 31 namespace content { |
32 | 32 |
33 class BrowserPluginGuest; | 33 class BrowserPluginGuest; |
34 class BrowserPluginHostFactory; | 34 class BrowserPluginHostFactory; |
35 class RenderProcessHostImpl; | 35 class RenderProcessHostImpl; |
36 class RenderWidgetHostImpl; | 36 class RenderWidgetHostImpl; |
37 class SiteInstance; | 37 class SiteInstance; |
38 class WebContents; | 38 class WebContents; |
39 class WebContentsImpl; | 39 class WebContentsImpl; |
40 struct NativeWebKeyboardEvent; | |
41 | 40 |
42 // WARNING: All APIs should be guarded with a process ID check like | 41 // WARNING: All APIs should be guarded with a process ID check like |
43 // CanEmbedderAccessInstanceIDMaybeKill, to prevent abuse by normal renderer | 42 // CanEmbedderAccessInstanceIDMaybeKill, to prevent abuse by normal renderer |
44 // processes. | 43 // processes. |
45 class CONTENT_EXPORT BrowserPluginGuestManager : | 44 class CONTENT_EXPORT BrowserPluginGuestManager : |
46 public base::SupportsUserData::Data { | 45 public base::SupportsUserData::Data { |
47 public: | 46 public: |
48 virtual ~BrowserPluginGuestManager(); | 47 virtual ~BrowserPluginGuestManager(); |
49 | 48 |
50 static BrowserPluginGuestManager* Create(); | 49 static BrowserPluginGuestManager* Create(); |
(...skipping 29 matching lines...) Expand all Loading... | |
80 | 79 |
81 // Removes the guest with the given |instance_id| from this | 80 // Removes the guest with the given |instance_id| from this |
82 // BrowserPluginGuestManager. | 81 // BrowserPluginGuestManager. |
83 void RemoveGuest(int instance_id); | 82 void RemoveGuest(int instance_id); |
84 | 83 |
85 // Returns whether the specified embedder is permitted to access the given | 84 // Returns whether the specified embedder is permitted to access the given |
86 // |instance_id|, and kills the embedder if not. | 85 // |instance_id|, and kills the embedder if not. |
87 bool CanEmbedderAccessInstanceIDMaybeKill(int embedder_render_process_id, | 86 bool CanEmbedderAccessInstanceIDMaybeKill(int embedder_render_process_id, |
88 int instance_id) const; | 87 int instance_id) const; |
89 | 88 |
90 void DidSendScreenRects(WebContentsImpl* embedder_web_contents); | 89 typedef base::Callback<bool(BrowserPluginGuest*)> GuestCallback; |
91 | 90 bool ForEachGuest(WebContentsImpl* embedder_web_contents, |
92 bool UnlockMouseIfNecessary(WebContentsImpl* embedder_web_contents_, | 91 GuestCallback callback); |
nasko
2014/01/08 17:58:42
Why not pass the callback as a const reference? An
Fady Samuel
2014/01/08 18:22:40
Done.
| |
93 const NativeWebKeyboardEvent& event); | |
94 | 92 |
95 void OnMessageReceived(const IPC::Message& message, int render_process_id); | 93 void OnMessageReceived(const IPC::Message& message, int render_process_id); |
96 | 94 |
97 private: | 95 private: |
98 friend class TestBrowserPluginGuestManager; | 96 friend class TestBrowserPluginGuestManager; |
99 | 97 |
100 BrowserPluginGuestManager(); | 98 BrowserPluginGuestManager(); |
101 | 99 |
102 // Returns whether the given embedder process is allowed to access the | 100 // Returns whether the given embedder process is allowed to access the |
103 // provided |guest|. | 101 // provided |guest|. |
(...skipping 26 matching lines...) Expand all Loading... | |
130 GuestInstanceMap guest_web_contents_by_instance_id_; | 128 GuestInstanceMap guest_web_contents_by_instance_id_; |
131 int next_instance_id_; | 129 int next_instance_id_; |
132 | 130 |
133 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuestManager); | 131 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuestManager); |
134 }; | 132 }; |
135 | 133 |
136 } // namespace content | 134 } // namespace content |
137 | 135 |
138 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ | 136 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ |
139 | 137 |
OLD | NEW |