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 | 379 !(extension_->location() == Extension::LOAD && |
380 && !CommandLine::ForCurrentProcess()->HasSwitch( | 380 CommandLine::ForCurrentProcess()->HasSwitch( |
381 switches::kExposePrivateExtensionApi) | 381 switches::kExposePrivateExtensionApi) |
382 #endif | 382 ) |
383 ) { | 383 ) { |
384 NOTREACHED() << "Private method access by non-component extension " | 384 NOTREACHED() << "Private method access by non-component extension " |
385 << extension_->id(); | 385 << extension_->id(); |
386 return false; | 386 return false; |
387 } | 387 } |
388 | 388 |
389 fileapi::FileSystemPathManager* path_manager = | 389 fileapi::FileSystemPathManager* path_manager = |
390 profile_->GetFileSystemContext()->path_manager(); | 390 profile_->GetFileSystemContext()->path_manager(); |
391 fileapi::ExternalFileSystemMountPointProvider* provider = | 391 fileapi::ExternalFileSystemMountPointProvider* provider = |
392 path_manager->external_provider(); | 392 path_manager->external_provider(); |
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); | 1675 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); |
1676 dict->SetString("PLAY_MEDIA", | 1676 dict->SetString("PLAY_MEDIA", |
1677 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); | 1677 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); |
1678 #if defined(OS_CHROMEOS) | 1678 #if defined(OS_CHROMEOS) |
1679 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePhotoEditor)) | 1679 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePhotoEditor)) |
1680 dict->SetString("ENABLE_PHOTO_EDITOR", "true"); | 1680 dict->SetString("ENABLE_PHOTO_EDITOR", "true"); |
1681 #endif | 1681 #endif |
1682 | 1682 |
1683 return true; | 1683 return true; |
1684 } | 1684 } |
OLD | NEW |