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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // If the version we're trying to register is older than the existing one, | 189 // If the version we're trying to register is older than the existing one, |
190 // don't do it. | 190 // don't do it. |
191 if (version.IsOlderThan(UTF16ToUTF8(it->version))) | 191 if (version.IsOlderThan(UTF16ToUTF8(it->version))) |
192 return; | 192 return; |
193 | 193 |
194 // If the version is newer, remove the old one first. | 194 // If the version is newer, remove the old one first. |
195 PluginService::GetInstance()->UnregisterInternalPlugin(it->path); | 195 PluginService::GetInstance()->UnregisterInternalPlugin(it->path); |
196 break; | 196 break; |
197 } | 197 } |
198 | 198 |
199 bool add_to_front = IsPepperFlashEnabledByDefault(); | |
200 PluginService::GetInstance()->RegisterInternalPlugin( | 199 PluginService::GetInstance()->RegisterInternalPlugin( |
201 plugin_info.ToWebPluginInfo(), add_to_front); | 200 plugin_info.ToWebPluginInfo(), true); |
202 PluginService::GetInstance()->RefreshPlugins(); | 201 PluginService::GetInstance()->RefreshPlugins(); |
203 } | 202 } |
204 | 203 |
205 // Returns true if this browser implements one of the interfaces given in | 204 // Returns true if this browser implements one of the interfaces given in |
206 // |interface_string|, which is a '|'-separated string of interface names. | 205 // |interface_string|, which is a '|'-separated string of interface names. |
207 bool CheckPepperFlashInterfaceString(const std::string& interface_string) { | 206 bool CheckPepperFlashInterfaceString(const std::string& interface_string) { |
208 std::vector<std::string> interface_names; | 207 std::vector<std::string> interface_names; |
209 base::SplitString(interface_string, '|', &interface_names); | 208 base::SplitString(interface_string, '|', &interface_names); |
210 for (size_t i = 0; i < interface_names.size(); i++) { | 209 for (size_t i = 0; i < interface_names.size(); i++) { |
211 if (SupportsPepperInterface(interface_names[i].c_str())) | 210 if (SupportsPepperInterface(interface_names[i].c_str())) |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 #endif // defined(GOOGLE_CHROME_BUILD) | 378 #endif // defined(GOOGLE_CHROME_BUILD) |
380 | 379 |
381 } // namespace | 380 } // namespace |
382 | 381 |
383 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { | 382 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { |
384 #if defined(GOOGLE_CHROME_BUILD) | 383 #if defined(GOOGLE_CHROME_BUILD) |
385 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 384 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
386 base::Bind(&StartPepperFlashUpdateRegistration, cus)); | 385 base::Bind(&StartPepperFlashUpdateRegistration, cus)); |
387 #endif | 386 #endif |
388 } | 387 } |
OLD | NEW |