OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_IMPL_H_ | 8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
9 #define CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 9 #define CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 ResourceContext* resource_context; | 62 ResourceContext* resource_context; |
63 }; | 63 }; |
64 | 64 |
65 class CONTENT_EXPORT PluginServiceImpl | 65 class CONTENT_EXPORT PluginServiceImpl |
66 : NON_EXPORTED_BASE(public PluginService) { | 66 : NON_EXPORTED_BASE(public PluginService) { |
67 public: | 67 public: |
68 // Returns the PluginServiceImpl singleton. | 68 // Returns the PluginServiceImpl singleton. |
69 static PluginServiceImpl* GetInstance(); | 69 static PluginServiceImpl* GetInstance(); |
70 | 70 |
71 // PluginService implementation: | 71 // PluginService implementation: |
72 virtual void Init() OVERRIDE; | 72 virtual void Init() override; |
73 virtual void StartWatchingPlugins() OVERRIDE; | 73 virtual void StartWatchingPlugins() override; |
74 virtual bool GetPluginInfoArray( | 74 virtual bool GetPluginInfoArray( |
75 const GURL& url, | 75 const GURL& url, |
76 const std::string& mime_type, | 76 const std::string& mime_type, |
77 bool allow_wildcard, | 77 bool allow_wildcard, |
78 std::vector<WebPluginInfo>* info, | 78 std::vector<WebPluginInfo>* info, |
79 std::vector<std::string>* actual_mime_types) OVERRIDE; | 79 std::vector<std::string>* actual_mime_types) override; |
80 virtual bool GetPluginInfo(int render_process_id, | 80 virtual bool GetPluginInfo(int render_process_id, |
81 int render_frame_id, | 81 int render_frame_id, |
82 ResourceContext* context, | 82 ResourceContext* context, |
83 const GURL& url, | 83 const GURL& url, |
84 const GURL& page_url, | 84 const GURL& page_url, |
85 const std::string& mime_type, | 85 const std::string& mime_type, |
86 bool allow_wildcard, | 86 bool allow_wildcard, |
87 bool* is_stale, | 87 bool* is_stale, |
88 WebPluginInfo* info, | 88 WebPluginInfo* info, |
89 std::string* actual_mime_type) OVERRIDE; | 89 std::string* actual_mime_type) override; |
90 virtual bool GetPluginInfoByPath(const base::FilePath& plugin_path, | 90 virtual bool GetPluginInfoByPath(const base::FilePath& plugin_path, |
91 WebPluginInfo* info) OVERRIDE; | 91 WebPluginInfo* info) override; |
92 virtual base::string16 GetPluginDisplayNameByPath( | 92 virtual base::string16 GetPluginDisplayNameByPath( |
93 const base::FilePath& path) OVERRIDE; | 93 const base::FilePath& path) override; |
94 virtual void GetPlugins(const GetPluginsCallback& callback) OVERRIDE; | 94 virtual void GetPlugins(const GetPluginsCallback& callback) override; |
95 virtual PepperPluginInfo* GetRegisteredPpapiPluginInfo( | 95 virtual PepperPluginInfo* GetRegisteredPpapiPluginInfo( |
96 const base::FilePath& plugin_path) OVERRIDE; | 96 const base::FilePath& plugin_path) override; |
97 virtual void SetFilter(PluginServiceFilter* filter) OVERRIDE; | 97 virtual void SetFilter(PluginServiceFilter* filter) override; |
98 virtual PluginServiceFilter* GetFilter() OVERRIDE; | 98 virtual PluginServiceFilter* GetFilter() override; |
99 virtual void ForcePluginShutdown(const base::FilePath& plugin_path) OVERRIDE; | 99 virtual void ForcePluginShutdown(const base::FilePath& plugin_path) override; |
100 virtual bool IsPluginUnstable(const base::FilePath& plugin_path) OVERRIDE; | 100 virtual bool IsPluginUnstable(const base::FilePath& plugin_path) override; |
101 virtual void RefreshPlugins() OVERRIDE; | 101 virtual void RefreshPlugins() override; |
102 virtual void AddExtraPluginPath(const base::FilePath& path) OVERRIDE; | 102 virtual void AddExtraPluginPath(const base::FilePath& path) override; |
103 virtual void RemoveExtraPluginPath(const base::FilePath& path) OVERRIDE; | 103 virtual void RemoveExtraPluginPath(const base::FilePath& path) override; |
104 virtual void AddExtraPluginDir(const base::FilePath& path) OVERRIDE; | 104 virtual void AddExtraPluginDir(const base::FilePath& path) override; |
105 virtual void RegisterInternalPlugin( | 105 virtual void RegisterInternalPlugin( |
106 const WebPluginInfo& info, bool add_at_beginning) OVERRIDE; | 106 const WebPluginInfo& info, bool add_at_beginning) override; |
107 virtual void UnregisterInternalPlugin(const base::FilePath& path) OVERRIDE; | 107 virtual void UnregisterInternalPlugin(const base::FilePath& path) override; |
108 virtual void GetInternalPlugins( | 108 virtual void GetInternalPlugins( |
109 std::vector<WebPluginInfo>* plugins) OVERRIDE; | 109 std::vector<WebPluginInfo>* plugins) override; |
110 virtual bool NPAPIPluginsSupported() OVERRIDE; | 110 virtual bool NPAPIPluginsSupported() override; |
111 virtual void DisablePluginsDiscoveryForTesting() OVERRIDE; | 111 virtual void DisablePluginsDiscoveryForTesting() override; |
112 #if defined(OS_MACOSX) | 112 #if defined(OS_MACOSX) |
113 virtual void AppActivated() OVERRIDE; | 113 virtual void AppActivated() override; |
114 #elif defined(OS_WIN) | 114 #elif defined(OS_WIN) |
115 virtual bool GetPluginInfoFromWindow(HWND window, | 115 virtual bool GetPluginInfoFromWindow(HWND window, |
116 base::string16* plugin_name, | 116 base::string16* plugin_name, |
117 base::string16* plugin_version) OVERRIDE; | 117 base::string16* plugin_version) override; |
118 | 118 |
119 // Returns true iff the given HWND is a plugin. | 119 // Returns true iff the given HWND is a plugin. |
120 bool IsPluginWindow(HWND window); | 120 bool IsPluginWindow(HWND window); |
121 #endif | 121 #endif |
122 virtual bool PpapiDevChannelSupported(BrowserContext* browser_context, | 122 virtual bool PpapiDevChannelSupported(BrowserContext* browser_context, |
123 const GURL& document_url) OVERRIDE; | 123 const GURL& document_url) override; |
124 | 124 |
125 // Returns the plugin process host corresponding to the plugin process that | 125 // Returns the plugin process host corresponding to the plugin process that |
126 // has been started by this service. This will start a process to host the | 126 // has been started by this service. This will start a process to host the |
127 // 'plugin_path' if needed. If the process fails to start, the return value | 127 // 'plugin_path' if needed. If the process fails to start, the return value |
128 // is NULL. Must be called on the IO thread. | 128 // is NULL. Must be called on the IO thread. |
129 PluginProcessHost* FindOrStartNpapiPluginProcess( | 129 PluginProcessHost* FindOrStartNpapiPluginProcess( |
130 int render_process_id, const base::FilePath& plugin_path); | 130 int render_process_id, const base::FilePath& plugin_path); |
131 PpapiPluginProcessHost* FindOrStartPpapiPluginProcess( | 131 PpapiPluginProcessHost* FindOrStartPpapiPluginProcess( |
132 int render_process_id, | 132 int render_process_id, |
133 const base::FilePath& plugin_path, | 133 const base::FilePath& plugin_path, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 // Used to detect if a given plug-in is crashing over and over. | 251 // Used to detect if a given plug-in is crashing over and over. |
252 std::map<base::FilePath, std::vector<base::Time> > crash_times_; | 252 std::map<base::FilePath, std::vector<base::Time> > crash_times_; |
253 | 253 |
254 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); | 254 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); |
255 }; | 255 }; |
256 | 256 |
257 } // namespace content | 257 } // namespace content |
258 | 258 |
259 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 259 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
OLD | NEW |