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 PluginService::GetInstance()->RegisterInternalPlugin( | 185 PluginService::GetInstance()->RegisterInternalPlugin( |
186 plugin_info.ToWebPluginInfo(), false); | 186 plugin_info.ToWebPluginInfo(), enable_by_default); |
Bernhard Bauer
2012/03/05 22:23:09
Could you move this into a separate variable |add_
yzshen1
2012/03/05 22:53:37
Done.
| |
187 PluginService::GetInstance()->RefreshPlugins(); | 187 PluginService::GetInstance()->RefreshPlugins(); |
188 } | 188 } |
189 | 189 |
190 // Returns true if this browser implements one of the interfaces given in | 190 // Returns true if this browser implements one of the interfaces given in |
191 // |interface_string|, which is a '|'-separated string of interface names. | 191 // |interface_string|, which is a '|'-separated string of interface names. |
192 bool CheckPepperFlashInterfaceString(const std::string& interface_string) { | 192 bool CheckPepperFlashInterfaceString(const std::string& interface_string) { |
193 std::vector<std::string> interface_names; | 193 std::vector<std::string> interface_names; |
194 base::SplitString(interface_string, '|', &interface_names); | 194 base::SplitString(interface_string, '|', &interface_names); |
195 for (size_t i = 0; i < interface_names.size(); i++) { | 195 for (size_t i = 0; i < interface_names.size(); i++) { |
196 if (SupportsPepperInterface(interface_names[i].c_str())) | 196 if (SupportsPepperInterface(interface_names[i].c_str())) |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
355 } | 355 } |
356 | 356 |
357 } // namespace | 357 } // namespace |
358 | 358 |
359 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { | 359 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { |
360 #if defined(GOOGLE_CHROME_BUILD) | 360 #if defined(GOOGLE_CHROME_BUILD) |
361 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 361 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
362 base::Bind(&StartPepperFlashUpdateRegistration, cus)); | 362 base::Bind(&StartPepperFlashUpdateRegistration, cus)); |
363 #endif | 363 #endif |
364 } | 364 } |
OLD | NEW |