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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 if (current_version_.CompareTo(version) > 0) | 275 if (current_version_.CompareTo(version) > 0) |
276 return false; | 276 return false; |
277 if (!file_util::PathExists(unpack_path.Append( | 277 if (!file_util::PathExists(unpack_path.Append( |
278 chrome::kPepperFlashPluginFilename))) | 278 chrome::kPepperFlashPluginFilename))) |
279 return false; | 279 return false; |
280 // Passed the basic tests. Time to install it. | 280 // Passed the basic tests. Time to install it. |
281 base::FilePath path = | 281 base::FilePath path = |
282 GetPepperFlashBaseDirectory().AppendASCII(version.GetString()); | 282 GetPepperFlashBaseDirectory().AppendASCII(version.GetString()); |
283 if (file_util::PathExists(path)) | 283 if (file_util::PathExists(path)) |
284 return false; | 284 return false; |
285 if (!file_util::Move(unpack_path, path)) | 285 if (!base::Move(unpack_path, path)) |
286 return false; | 286 return false; |
287 // Installation is done. Now tell the rest of chrome. Both the path service | 287 // Installation is done. Now tell the rest of chrome. Both the path service |
288 // and to the plugin service. | 288 // and to the plugin service. |
289 current_version_ = version; | 289 current_version_ = version; |
290 PathService::Override(chrome::DIR_PEPPER_FLASH_PLUGIN, path); | 290 PathService::Override(chrome::DIR_PEPPER_FLASH_PLUGIN, path); |
291 path = path.Append(chrome::kPepperFlashPluginFilename); | 291 path = path.Append(chrome::kPepperFlashPluginFilename); |
292 BrowserThread::PostTask( | 292 BrowserThread::PostTask( |
293 BrowserThread::UI, FROM_HERE, | 293 BrowserThread::UI, FROM_HERE, |
294 base::Bind(&RegisterPepperFlashWithChrome, path, version)); | 294 base::Bind(&RegisterPepperFlashWithChrome, path, version)); |
295 return true; | 295 return true; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) | 396 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) |
397 // Component updated flash supersedes bundled flash therefore if that one | 397 // Component updated flash supersedes bundled flash therefore if that one |
398 // is disabled then this one should never install. | 398 // is disabled then this one should never install. |
399 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 399 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
400 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) | 400 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) |
401 return; | 401 return; |
402 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 402 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
403 base::Bind(&StartPepperFlashUpdateRegistration, cus)); | 403 base::Bind(&StartPepperFlashUpdateRegistration, cus)); |
404 #endif | 404 #endif |
405 } | 405 } |
OLD | NEW |