| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/extension_info_generat
or.h" | 5 #include "chrome/browser/extensions/api/developer_private/extension_info_generat
or.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 22 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 23 #include "chrome/common/extensions/command.h" | 23 #include "chrome/common/extensions/command.h" |
| 24 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 24 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
| 25 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
| 26 #include "chrome/grit/generated_resources.h" | 26 #include "chrome/grit/generated_resources.h" |
| 27 #include "content/public/browser/render_frame_host.h" | 27 #include "content/public/browser/render_frame_host.h" |
| 28 #include "extensions/browser/extension_error.h" | 28 #include "extensions/browser/extension_error.h" |
| 29 #include "extensions/browser/extension_prefs.h" | 29 #include "extensions/browser/extension_prefs.h" |
| 30 #include "extensions/browser/extension_registry.h" | 30 #include "extensions/browser/extension_registry.h" |
| 31 #include "extensions/browser/extension_system.h" | 31 #include "extensions/browser/extension_system.h" |
| 32 #include "extensions/browser/extension_util.h" |
| 32 #include "extensions/browser/image_loader.h" | 33 #include "extensions/browser/image_loader.h" |
| 33 #include "extensions/browser/warning_service.h" | 34 #include "extensions/browser/warning_service.h" |
| 34 #include "extensions/common/extension_set.h" | 35 #include "extensions/common/extension_set.h" |
| 35 #include "extensions/common/feature_switch.h" | 36 #include "extensions/common/feature_switch.h" |
| 36 #include "extensions/common/install_warning.h" | 37 #include "extensions/common/install_warning.h" |
| 37 #include "extensions/common/manifest.h" | 38 #include "extensions/common/manifest.h" |
| 38 #include "extensions/common/manifest_handlers/background_info.h" | 39 #include "extensions/common/manifest_handlers/background_info.h" |
| 39 #include "extensions/common/manifest_handlers/icons_handler.h" | 40 #include "extensions/common/manifest_handlers/icons_handler.h" |
| 40 #include "extensions/common/manifest_handlers/offline_enabled_info.h" | 41 #include "extensions/common/manifest_handlers/offline_enabled_info.h" |
| 41 #include "extensions/common/manifest_handlers/options_page_info.h" | 42 #include "extensions/common/manifest_handlers/options_page_info.h" |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 info->file_access.is_active = | 394 info->file_access.is_active = |
| 394 util::AllowFileAccess(extension.id(), browser_context_); | 395 util::AllowFileAccess(extension.id(), browser_context_); |
| 395 | 396 |
| 396 // Home page. | 397 // Home page. |
| 397 info->home_page.url = ManifestURL::GetHomepageURL(&extension).spec(); | 398 info->home_page.url = ManifestURL::GetHomepageURL(&extension).spec(); |
| 398 info->home_page.specified = ManifestURL::SpecifiedHomepageURL(&extension); | 399 info->home_page.specified = ManifestURL::SpecifiedHomepageURL(&extension); |
| 399 | 400 |
| 400 info->id = extension.id(); | 401 info->id = extension.id(); |
| 401 | 402 |
| 402 // Incognito access. | 403 // Incognito access. |
| 403 info->incognito_access.is_enabled = extension.can_be_incognito_enabled(); | 404 info->incognito_access.is_enabled = util::CanBeIncognitoEnabled(&extension); |
| 404 info->incognito_access.is_active = | 405 info->incognito_access.is_active = |
| 405 util::IsIncognitoEnabled(extension.id(), browser_context_); | 406 util::IsIncognitoEnabled(extension.id(), browser_context_); |
| 406 | 407 |
| 407 // Install warnings, but only if unpacked, the error console isn't enabled | 408 // Install warnings, but only if unpacked, the error console isn't enabled |
| 408 // (otherwise it shows these), and we're in developer mode (normal users don't | 409 // (otherwise it shows these), and we're in developer mode (normal users don't |
| 409 // need to see these). | 410 // need to see these). |
| 410 if (!error_console_enabled && | 411 if (!error_console_enabled && |
| 411 Manifest::IsUnpackedLocation(extension.location()) && | 412 Manifest::IsUnpackedLocation(extension.location()) && |
| 412 profile->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)) { | 413 profile->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)) { |
| 413 const std::vector<InstallWarning>& install_warnings = | 414 const std::vector<InstallWarning>& install_warnings = |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 // that at the end of the method, any stored refs are destroyed. | 624 // that at the end of the method, any stored refs are destroyed. |
| 624 ExtensionInfoList list; | 625 ExtensionInfoList list; |
| 625 list.swap(list_); | 626 list.swap(list_); |
| 626 ExtensionInfosCallback callback = callback_; | 627 ExtensionInfosCallback callback = callback_; |
| 627 callback_.Reset(); | 628 callback_.Reset(); |
| 628 callback.Run(list); // WARNING: |this| is possibly deleted after this line! | 629 callback.Run(list); // WARNING: |this| is possibly deleted after this line! |
| 629 } | 630 } |
| 630 } | 631 } |
| 631 | 632 |
| 632 } // namespace extensions | 633 } // namespace extensions |
| OLD | NEW |