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/common/chrome_content_client.h" | 5 #include "chrome/common/chrome_content_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 switches::kEnableBundledPpapiFlash); | 225 switches::kEnableBundledPpapiFlash); |
226 #endif | 226 #endif |
227 bundled_flapper_enabled &= !CommandLine::ForCurrentProcess()->HasSwitch( | 227 bundled_flapper_enabled &= !CommandLine::ForCurrentProcess()->HasSwitch( |
228 switches::kDisableBundledPpapiFlash); | 228 switches::kDisableBundledPpapiFlash); |
229 if (!bundled_flapper_enabled) | 229 if (!bundled_flapper_enabled) |
230 return; | 230 return; |
231 | 231 |
232 #if defined(FLAPPER_AVAILABLE) | 232 #if defined(FLAPPER_AVAILABLE) |
233 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &plugin.path)) | 233 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &plugin.path)) |
234 return; | 234 return; |
| 235 // It is an error to have FLAPPER_AVAILABLE defined but then not having the |
| 236 // plugin file in place, but this happens in Chrome OS builds. |
| 237 // Use --disable-bundled-ppapi-flash to skip this. |
| 238 DCHECK(file_util::PathExists(plugin.path)); |
235 flash_version = FLAPPER_VERSION_STRING; | 239 flash_version = FLAPPER_VERSION_STRING; |
236 #else | 240 #else |
237 LOG(ERROR) << "PPAPI Flash not included at build time."; | 241 LOG(ERROR) << "PPAPI Flash not included at build time."; |
238 return; | 242 return; |
239 #endif // FLAPPER_AVAILABLE | 243 #endif // FLAPPER_AVAILABLE |
240 } | 244 } |
241 | 245 |
242 std::vector<std::string> flash_version_numbers; | 246 std::vector<std::string> flash_version_numbers; |
243 base::SplitString(flash_version, '.', &flash_version_numbers); | 247 base::SplitString(flash_version, '.', &flash_version_numbers); |
244 if (flash_version_numbers.size() < 1) | 248 if (flash_version_numbers.size() < 1) |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 DCHECK(sandbox_profile_resource_id); | 469 DCHECK(sandbox_profile_resource_id); |
466 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) { | 470 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) { |
467 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 471 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
468 return true; | 472 return true; |
469 } | 473 } |
470 return false; | 474 return false; |
471 } | 475 } |
472 #endif | 476 #endif |
473 | 477 |
474 } // namespace chrome | 478 } // namespace chrome |
OLD | NEW |