| 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 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); | 1679 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); |
| 1685 dict->SetString("PLAY_MEDIA", | 1680 dict->SetString("PLAY_MEDIA", |
| 1686 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); | 1681 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); |
| 1687 #if defined(OS_CHROMEOS) | 1682 #if defined(OS_CHROMEOS) |
| 1688 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePhotoEditor)) | 1683 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePhotoEditor)) |
| 1689 dict->SetString("ENABLE_PHOTO_EDITOR", "true"); | 1684 dict->SetString("ENABLE_PHOTO_EDITOR", "true"); |
| 1690 #endif | 1685 #endif |
| 1691 | 1686 |
| 1692 return true; | 1687 return true; |
| 1693 } | 1688 } |
| OLD | NEW |