| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_file_browser_private_api.h" | 5 #include "chrome/browser/extensions/extension_file_browser_private_api.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 368 |
| 369 private: | 369 private: |
| 370 | 370 |
| 371 // Grants file system access permissions to file browser component. | 371 // Grants file system access permissions to file browser component. |
| 372 bool SetupFileSystemAccessPermissions() { | 372 bool SetupFileSystemAccessPermissions() { |
| 373 if (!extension_.get()) | 373 if (!extension_.get()) |
| 374 return false; | 374 return false; |
| 375 | 375 |
| 376 // Make sure that only component extension can access the entire | 376 // Make sure that only component extension can access the entire |
| 377 // local file system. | 377 // local file system. |
| 378 if (extension_->location() != Extension::COMPONENT | 378 if (extension_->location() != Extension::COMPONENT) { |
| 379 #ifndef NDEBUG | |
| 380 && !CommandLine::ForCurrentProcess()->HasSwitch( | |
| 381 switches::kExposePrivateExtensionApi) | |
| 382 #endif | |
| 383 ) { | |
| 384 NOTREACHED() << "Private method access by non-component extension " | 379 NOTREACHED() << "Private method access by non-component extension " |
| 385 << extension_->id(); | 380 << extension_->id(); |
| 386 return false; | 381 return false; |
| 387 } | 382 } |
| 388 | 383 |
| 389 fileapi::FileSystemPathManager* path_manager = | 384 fileapi::FileSystemPathManager* path_manager = |
| 390 profile_->GetFileSystemContext()->path_manager(); | 385 profile_->GetFileSystemContext()->path_manager(); |
| 391 fileapi::ExternalFileSystemMountPointProvider* provider = | 386 fileapi::ExternalFileSystemMountPointProvider* provider = |
| 392 path_manager->external_provider(); | 387 path_manager->external_provider(); |
| 393 if (!provider) | 388 if (!provider) |
| (...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1675 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); | 1670 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); |
| 1676 dict->SetString("PLAY_MEDIA", | 1671 dict->SetString("PLAY_MEDIA", |
| 1677 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); | 1672 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); |
| 1678 #if defined(OS_CHROMEOS) | 1673 #if defined(OS_CHROMEOS) |
| 1679 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePhotoEditor)) | 1674 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePhotoEditor)) |
| 1680 dict->SetString("ENABLE_PHOTO_EDITOR", "true"); | 1675 dict->SetString("ENABLE_PHOTO_EDITOR", "true"); |
| 1681 #endif | 1676 #endif |
| 1682 | 1677 |
| 1683 return true; | 1678 return true; |
| 1684 } | 1679 } |
| OLD | NEW |