OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 public: | 243 public: |
244 explicit PepperFlashComponentInstaller(const Version& version); | 244 explicit PepperFlashComponentInstaller(const Version& version); |
245 | 245 |
246 virtual ~PepperFlashComponentInstaller() {} | 246 virtual ~PepperFlashComponentInstaller() {} |
247 | 247 |
248 virtual void OnUpdateError(int error) OVERRIDE; | 248 virtual void OnUpdateError(int error) OVERRIDE; |
249 | 249 |
250 virtual bool Install(const base::DictionaryValue& manifest, | 250 virtual bool Install(const base::DictionaryValue& manifest, |
251 const base::FilePath& unpack_path) OVERRIDE; | 251 const base::FilePath& unpack_path) OVERRIDE; |
252 | 252 |
| 253 virtual bool GetInstalledFile(const std::string& file, |
| 254 base::FilePath* installed_file) OVERRIDE; |
| 255 |
253 private: | 256 private: |
254 Version current_version_; | 257 Version current_version_; |
255 }; | 258 }; |
256 | 259 |
257 PepperFlashComponentInstaller::PepperFlashComponentInstaller( | 260 PepperFlashComponentInstaller::PepperFlashComponentInstaller( |
258 const Version& version) : current_version_(version) { | 261 const Version& version) : current_version_(version) { |
259 DCHECK(version.IsValid()); | 262 DCHECK(version.IsValid()); |
260 } | 263 } |
261 | 264 |
262 void PepperFlashComponentInstaller::OnUpdateError(int error) { | 265 void PepperFlashComponentInstaller::OnUpdateError(int error) { |
(...skipping 22 matching lines...) Expand all Loading... |
285 // and to the plugin service. | 288 // and to the plugin service. |
286 current_version_ = version; | 289 current_version_ = version; |
287 PathService::Override(chrome::DIR_PEPPER_FLASH_PLUGIN, path); | 290 PathService::Override(chrome::DIR_PEPPER_FLASH_PLUGIN, path); |
288 path = path.Append(chrome::kPepperFlashPluginFilename); | 291 path = path.Append(chrome::kPepperFlashPluginFilename); |
289 BrowserThread::PostTask( | 292 BrowserThread::PostTask( |
290 BrowserThread::UI, FROM_HERE, | 293 BrowserThread::UI, FROM_HERE, |
291 base::Bind(&RegisterPepperFlashWithChrome, path, version)); | 294 base::Bind(&RegisterPepperFlashWithChrome, path, version)); |
292 return true; | 295 return true; |
293 } | 296 } |
294 | 297 |
| 298 bool PepperFlashComponentInstaller::GetInstalledFile( |
| 299 const std::string& file, base::FilePath* installed_file) { |
| 300 return false; |
| 301 } |
| 302 |
295 bool CheckPepperFlashManifest(const base::DictionaryValue& manifest, | 303 bool CheckPepperFlashManifest(const base::DictionaryValue& manifest, |
296 Version* version_out) { | 304 Version* version_out) { |
297 std::string name; | 305 std::string name; |
298 manifest.GetStringASCII("name", &name); | 306 manifest.GetStringASCII("name", &name); |
299 // TODO(viettrungluu): Support WinFlapper for now, while we change the format | 307 // TODO(viettrungluu): Support WinFlapper for now, while we change the format |
300 // of the manifest. (Should be safe to remove checks for "WinFlapper" in, say, | 308 // of the manifest. (Should be safe to remove checks for "WinFlapper" in, say, |
301 // Nov. 2011.) crbug.com/98458 | 309 // Nov. 2011.) crbug.com/98458 |
302 if (name != kPepperFlashManifestName && name != "WinFlapper") | 310 if (name != kPepperFlashManifestName && name != "WinFlapper") |
303 return false; | 311 return false; |
304 | 312 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) | 396 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) |
389 // Component updated flash supersedes bundled flash therefore if that one | 397 // Component updated flash supersedes bundled flash therefore if that one |
390 // is disabled then this one should never install. | 398 // is disabled then this one should never install. |
391 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 399 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
392 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) | 400 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) |
393 return; | 401 return; |
394 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 402 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
395 base::Bind(&StartPepperFlashUpdateRegistration, cus)); | 403 base::Bind(&StartPepperFlashUpdateRegistration, cus)); |
396 #endif | 404 #endif |
397 } | 405 } |
OLD | NEW |