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 // This class responds to requests from renderers for the list of plugins, and | 5 // This class responds to requests from renderers for the list of plugins, and |
6 // also a proxy object for plugin instances. | 6 // also a proxy object for plugin instances. |
7 | 7 |
8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_H_ | 8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_H_ |
9 #define CONTENT_BROWSER_PLUGIN_SERVICE_H_ | 9 #define CONTENT_BROWSER_PLUGIN_SERVICE_H_ |
10 #pragma once | 10 #pragma once |
11 | 11 |
12 #include <string> | 12 #include <string> |
| 13 #include <vector> |
13 | 14 |
14 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
15 #include "base/file_path.h" | 16 #include "base/file_path.h" |
16 #include "base/hash_tables.h" | 17 #include "base/hash_tables.h" |
17 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
18 #include "base/memory/singleton.h" | 19 #include "base/memory/singleton.h" |
19 #include "base/synchronization/lock.h" | 20 #include "base/synchronization/lock.h" |
20 #include "base/synchronization/waitable_event_watcher.h" | 21 #include "base/synchronization/waitable_event_watcher.h" |
21 #include "build/build_config.h" | 22 #include "build/build_config.h" |
22 #include "content/browser/plugin_process_host.h" | 23 #include "content/browser/plugin_process_host.h" |
(...skipping 19 matching lines...) Expand all Loading... |
42 | 43 |
43 // This must be created on the main thread but it's only called on the IO/file | 44 // This must be created on the main thread but it's only called on the IO/file |
44 // thread. | 45 // thread. |
45 class PluginService | 46 class PluginService |
46 : public base::WaitableEventWatcher::Delegate, | 47 : public base::WaitableEventWatcher::Delegate, |
47 public NotificationObserver { | 48 public NotificationObserver { |
48 public: | 49 public: |
49 struct OverriddenPlugin { | 50 struct OverriddenPlugin { |
50 int render_process_id; | 51 int render_process_id; |
51 int render_view_id; | 52 int render_view_id; |
52 GURL url; | 53 GURL url; // If empty, the override applies to all urls in render_view. |
53 webkit::WebPluginInfo plugin; | 54 webkit::WebPluginInfo plugin; |
54 }; | 55 }; |
55 | 56 |
56 // Returns the PluginService singleton. | 57 // Returns the PluginService singleton. |
57 static PluginService* GetInstance(); | 58 static PluginService* GetInstance(); |
58 | 59 |
59 // Gets the browser's UI locale. | 60 // Gets the browser's UI locale. |
60 const std::string& GetUILocale(); | 61 const std::string& GetUILocale(); |
61 | 62 |
62 // Returns the plugin process host corresponding to the plugin process that | 63 // Returns the plugin process host corresponding to the plugin process that |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 189 |
189 std::vector<OverriddenPlugin> overridden_plugins_; | 190 std::vector<OverriddenPlugin> overridden_plugins_; |
190 base::Lock overridden_plugins_lock_; | 191 base::Lock overridden_plugins_lock_; |
191 | 192 |
192 DISALLOW_COPY_AND_ASSIGN(PluginService); | 193 DISALLOW_COPY_AND_ASSIGN(PluginService); |
193 }; | 194 }; |
194 | 195 |
195 DISABLE_RUNNABLE_METHOD_REFCOUNT(PluginService); | 196 DISABLE_RUNNABLE_METHOD_REFCOUNT(PluginService); |
196 | 197 |
197 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_H_ | 198 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_H_ |
OLD | NEW |