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/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "chrome/browser/profiles/profile.h" | 32 #include "chrome/browser/profiles/profile.h" |
33 #include "chrome/browser/web_applications/web_app.h" | 33 #include "chrome/browser/web_applications/web_app.h" |
34 #include "chrome/common/chrome_paths.h" | 34 #include "chrome/common/chrome_paths.h" |
35 #include "chrome/common/extensions/extension_constants.h" | 35 #include "chrome/common/extensions/extension_constants.h" |
36 #include "chrome/grit/generated_resources.h" | 36 #include "chrome/grit/generated_resources.h" |
37 #include "content/public/browser/browser_thread.h" | 37 #include "content/public/browser/browser_thread.h" |
38 #include "content/public/browser/notification_service.h" | 38 #include "content/public/browser/notification_service.h" |
39 #include "content/public/browser/resource_dispatcher_host.h" | 39 #include "content/public/browser/resource_dispatcher_host.h" |
40 #include "content/public/browser/user_metrics.h" | 40 #include "content/public/browser/user_metrics.h" |
41 #include "extensions/browser/extension_prefs.h" | 41 #include "extensions/browser/extension_prefs.h" |
| 42 #include "extensions/browser/extension_registry.h" |
42 #include "extensions/browser/extension_system.h" | 43 #include "extensions/browser/extension_system.h" |
43 #include "extensions/browser/install/crx_installer_error.h" | 44 #include "extensions/browser/install/crx_installer_error.h" |
44 #include "extensions/browser/install/extension_install_ui.h" | 45 #include "extensions/browser/install/extension_install_ui.h" |
45 #include "extensions/browser/install_flag.h" | 46 #include "extensions/browser/install_flag.h" |
46 #include "extensions/browser/notification_types.h" | 47 #include "extensions/browser/notification_types.h" |
47 #include "extensions/common/extension_icon_set.h" | 48 #include "extensions/common/extension_icon_set.h" |
48 #include "extensions/common/feature_switch.h" | 49 #include "extensions/common/feature_switch.h" |
49 #include "extensions/common/file_util.h" | 50 #include "extensions/common/file_util.h" |
50 #include "extensions/common/manifest.h" | 51 #include "extensions/common/manifest.h" |
51 #include "extensions/common/manifest_handlers/kiosk_mode_info.h" | 52 #include "extensions/common/manifest_handlers/kiosk_mode_info.h" |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 IDS_EXTENSION_INSTALL_KIOSK_MODE_ONLY))); | 591 IDS_EXTENSION_INSTALL_KIOSK_MODE_ONLY))); |
591 return; | 592 return; |
592 } | 593 } |
593 } | 594 } |
594 | 595 |
595 // Check whether this install is initiated from the settings page to | 596 // Check whether this install is initiated from the settings page to |
596 // update an existing extension or app. | 597 // update an existing extension or app. |
597 CheckUpdateFromSettingsPage(); | 598 CheckUpdateFromSettingsPage(); |
598 | 599 |
599 GURL overlapping_url; | 600 GURL overlapping_url; |
| 601 ExtensionRegistry* registry = ExtensionRegistry::Get(service->profile()); |
600 const Extension* overlapping_extension = | 602 const Extension* overlapping_extension = |
601 service->extensions()->GetHostedAppByOverlappingWebExtent( | 603 registry->enabled_extensions().GetHostedAppByOverlappingWebExtent( |
602 extension()->web_extent()); | 604 extension()->web_extent()); |
603 if (overlapping_extension && | 605 if (overlapping_extension && |
604 overlapping_extension->id() != extension()->id()) { | 606 overlapping_extension->id() != extension()->id()) { |
605 ReportFailureFromUIThread( | 607 ReportFailureFromUIThread( |
606 CrxInstallerError( | 608 CrxInstallerError( |
607 l10n_util::GetStringFUTF16( | 609 l10n_util::GetStringFUTF16( |
608 IDS_EXTENSION_OVERLAPPING_WEB_EXTENT, | 610 IDS_EXTENSION_OVERLAPPING_WEB_EXTENT, |
609 base::UTF8ToUTF16(overlapping_extension->name())))); | 611 base::UTF8ToUTF16(overlapping_extension->name())))); |
610 return; | 612 return; |
611 } | 613 } |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) | 902 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) |
901 return; | 903 return; |
902 | 904 |
903 if (client_) { | 905 if (client_) { |
904 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). | 906 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). |
905 client_->ConfirmReEnable(this, extension()); | 907 client_->ConfirmReEnable(this, extension()); |
906 } | 908 } |
907 } | 909 } |
908 | 910 |
909 } // namespace extensions | 911 } // namespace extensions |
OLD | NEW |