| 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/browser/extensions/api/developer_private/developer_private_api.
h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api.
h" |
| 6 | 6 |
| 7 #include "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
| 8 #include "apps/app_restore_service.h" | 8 #include "apps/app_restore_service.h" |
| 9 #include "apps/app_window.h" | 9 #include "apps/app_window.h" |
| 10 #include "apps/app_window_registry.h" | 10 #include "apps/app_window_registry.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 #include "extensions/browser/view_type_utils.h" | 58 #include "extensions/browser/view_type_utils.h" |
| 59 #include "extensions/common/constants.h" | 59 #include "extensions/common/constants.h" |
| 60 #include "extensions/common/extension_resource.h" | 60 #include "extensions/common/extension_resource.h" |
| 61 #include "extensions/common/extension_set.h" | 61 #include "extensions/common/extension_set.h" |
| 62 #include "extensions/common/install_warning.h" | 62 #include "extensions/common/install_warning.h" |
| 63 #include "extensions/common/manifest.h" | 63 #include "extensions/common/manifest.h" |
| 64 #include "extensions/common/manifest_handlers/background_info.h" | 64 #include "extensions/common/manifest_handlers/background_info.h" |
| 65 #include "extensions/common/manifest_handlers/icons_handler.h" | 65 #include "extensions/common/manifest_handlers/icons_handler.h" |
| 66 #include "extensions/common/manifest_handlers/incognito_info.h" | 66 #include "extensions/common/manifest_handlers/incognito_info.h" |
| 67 #include "extensions/common/manifest_handlers/offline_enabled_info.h" | 67 #include "extensions/common/manifest_handlers/offline_enabled_info.h" |
| 68 #include "extensions/common/permissions/permissions_data.h" |
| 68 #include "extensions/common/switches.h" | 69 #include "extensions/common/switches.h" |
| 69 #include "grit/chromium_strings.h" | 70 #include "grit/chromium_strings.h" |
| 70 #include "grit/generated_resources.h" | 71 #include "grit/generated_resources.h" |
| 71 #include "grit/theme_resources.h" | 72 #include "grit/theme_resources.h" |
| 72 #include "net/base/net_util.h" | 73 #include "net/base/net_util.h" |
| 73 #include "ui/base/l10n/l10n_util.h" | 74 #include "ui/base/l10n/l10n_util.h" |
| 74 #include "ui/base/resource/resource_bundle.h" | 75 #include "ui/base/resource/resource_bundle.h" |
| 75 #include "ui/base/webui/web_ui_util.h" | 76 #include "ui/base/webui/web_ui_util.h" |
| 76 #include "webkit/browser/fileapi/external_mount_points.h" | 77 #include "webkit/browser/fileapi/external_mount_points.h" |
| 77 #include "webkit/browser/fileapi/file_system_context.h" | 78 #include "webkit/browser/fileapi/file_system_context.h" |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 const Extension* extension = | 741 const Extension* extension = |
| 741 ExtensionRegistry::Get(GetProfile()) | 742 ExtensionRegistry::Get(GetProfile()) |
| 742 ->GetExtensionById(extension_id_, ExtensionRegistry::EVERYTHING); | 743 ->GetExtensionById(extension_id_, ExtensionRegistry::EVERYTHING); |
| 743 | 744 |
| 744 if (!extension) | 745 if (!extension) |
| 745 return false; | 746 return false; |
| 746 | 747 |
| 747 // Released by InstallUIAbort or InstallUIProceed. | 748 // Released by InstallUIAbort or InstallUIProceed. |
| 748 AddRef(); | 749 AddRef(); |
| 749 std::vector<base::FilePath> retained_file_paths; | 750 std::vector<base::FilePath> retained_file_paths; |
| 750 if (extension->HasAPIPermission(APIPermission::kFileSystem)) { | 751 if (extension->permissions_data()->HasAPIPermission( |
| 752 APIPermission::kFileSystem)) { |
| 751 std::vector<apps::SavedFileEntry> retained_file_entries = | 753 std::vector<apps::SavedFileEntry> retained_file_entries = |
| 752 apps::SavedFilesService::Get(GetProfile()) | 754 apps::SavedFilesService::Get(GetProfile()) |
| 753 ->GetAllFileEntries(extension_id_); | 755 ->GetAllFileEntries(extension_id_); |
| 754 for (size_t i = 0; i < retained_file_entries.size(); i++) { | 756 for (size_t i = 0; i < retained_file_entries.size(); i++) { |
| 755 retained_file_paths.push_back(retained_file_entries[i].path); | 757 retained_file_paths.push_back(retained_file_entries[i].path); |
| 756 } | 758 } |
| 757 } | 759 } |
| 758 prompt_->ReviewPermissions(this, extension, retained_file_paths); | 760 prompt_->ReviewPermissions(this, extension, retained_file_paths); |
| 759 return true; | 761 return true; |
| 760 } | 762 } |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 } | 1374 } |
| 1373 | 1375 |
| 1374 error_ui_util::HandleOpenDevTools(dict); | 1376 error_ui_util::HandleOpenDevTools(dict); |
| 1375 | 1377 |
| 1376 return true; | 1378 return true; |
| 1377 } | 1379 } |
| 1378 | 1380 |
| 1379 } // namespace api | 1381 } // namespace api |
| 1380 | 1382 |
| 1381 } // namespace extensions | 1383 } // namespace extensions |
| OLD | NEW |