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 #include "chrome/browser/component_updater/flash_component_installer.h" | 5 #include "chrome/browser/component_updater/flash_component_installer.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 // If it is a |fresh_install| we enable or disable it by default in some | 172 // If it is a |fresh_install| we enable or disable it by default in some |
173 // configurations. See IsPepperFlashEnabledByDefault() for more information. | 173 // configurations. See IsPepperFlashEnabledByDefault() for more information. |
174 void RegisterPepperFlashWithChrome(const FilePath& path, | 174 void RegisterPepperFlashWithChrome(const FilePath& path, |
175 const Version& version, | 175 const Version& version, |
176 bool fresh_install) { | 176 bool fresh_install) { |
177 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 177 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
178 content::PepperPluginInfo plugin_info; | 178 content::PepperPluginInfo plugin_info; |
179 if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info)) | 179 if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info)) |
180 return; | 180 return; |
181 if (fresh_install) { | 181 bool enable_by_default = IsPepperFlashEnabledByDefault(); |
182 PluginPrefs::EnablePluginGlobally(IsPepperFlashEnabledByDefault(), | 182 if (fresh_install) |
183 plugin_info.path); | 183 PluginPrefs::EnablePluginGlobally(enable_by_default, plugin_info.path); |
184 } | 184 |
| 185 bool add_to_front = enable_by_default; |
185 PluginService::GetInstance()->RegisterInternalPlugin( | 186 PluginService::GetInstance()->RegisterInternalPlugin( |
186 plugin_info.ToWebPluginInfo(), false); | 187 plugin_info.ToWebPluginInfo(), add_to_front); |
187 PluginService::GetInstance()->RefreshPlugins(); | 188 PluginService::GetInstance()->RefreshPlugins(); |
188 } | 189 } |
189 | 190 |
190 // Returns true if this browser implements one of the interfaces given in | 191 // Returns true if this browser implements one of the interfaces given in |
191 // |interface_string|, which is a '|'-separated string of interface names. | 192 // |interface_string|, which is a '|'-separated string of interface names. |
192 bool CheckPepperFlashInterfaceString(const std::string& interface_string) { | 193 bool CheckPepperFlashInterfaceString(const std::string& interface_string) { |
193 std::vector<std::string> interface_names; | 194 std::vector<std::string> interface_names; |
194 base::SplitString(interface_string, '|', &interface_names); | 195 base::SplitString(interface_string, '|', &interface_names); |
195 for (size_t i = 0; i < interface_names.size(); i++) { | 196 for (size_t i = 0; i < interface_names.size(); i++) { |
196 if (SupportsPepperInterface(interface_names[i].c_str())) | 197 if (SupportsPepperInterface(interface_names[i].c_str())) |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 } | 356 } |
356 | 357 |
357 } // namespace | 358 } // namespace |
358 | 359 |
359 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { | 360 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { |
360 #if defined(GOOGLE_CHROME_BUILD) | 361 #if defined(GOOGLE_CHROME_BUILD) |
361 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 362 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
362 base::Bind(&StartPepperFlashUpdateRegistration, cus)); | 363 base::Bind(&StartPepperFlashUpdateRegistration, cus)); |
363 #endif | 364 #endif |
364 } | 365 } |
OLD | NEW |