| 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/management/management_api.h" | 5 #include "chrome/browser/extensions/api/management/management_api.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "chrome/common/chrome_notification_types.h" | 31 #include "chrome/common/chrome_notification_types.h" |
| 32 #include "chrome/common/chrome_utility_messages.h" | 32 #include "chrome/common/chrome_utility_messages.h" |
| 33 #include "chrome/common/extensions/api/management.h" | 33 #include "chrome/common/extensions/api/management.h" |
| 34 #include "chrome/common/extensions/extension.h" | 34 #include "chrome/common/extensions/extension.h" |
| 35 #include "chrome/common/extensions/extension_constants.h" | 35 #include "chrome/common/extensions/extension_constants.h" |
| 36 #include "chrome/common/extensions/extension_icon_set.h" | 36 #include "chrome/common/extensions/extension_icon_set.h" |
| 37 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" | 37 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" |
| 38 #include "chrome/common/extensions/manifest_handlers/offline_enabled_info.h" | 38 #include "chrome/common/extensions/manifest_handlers/offline_enabled_info.h" |
| 39 #include "chrome/common/extensions/manifest_url_handler.h" | 39 #include "chrome/common/extensions/manifest_url_handler.h" |
| 40 #include "chrome/common/extensions/permissions/permission_set.h" | 40 #include "chrome/common/extensions/permissions/permission_set.h" |
| 41 #include "chrome/common/extensions/permissions/permissions_data.h" |
| 41 #include "content/public/browser/notification_details.h" | 42 #include "content/public/browser/notification_details.h" |
| 42 #include "content/public/browser/notification_source.h" | 43 #include "content/public/browser/notification_source.h" |
| 43 #include "content/public/browser/utility_process_host.h" | 44 #include "content/public/browser/utility_process_host.h" |
| 44 #include "content/public/browser/utility_process_host_client.h" | 45 #include "content/public/browser/utility_process_host_client.h" |
| 45 #include "extensions/common/error_utils.h" | 46 #include "extensions/common/error_utils.h" |
| 46 #include "extensions/common/url_pattern.h" | 47 #include "extensions/common/url_pattern.h" |
| 47 | 48 |
| 48 #if !defined(OS_ANDROID) | 49 #if !defined(OS_ANDROID) |
| 49 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 50 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
| 50 #endif | 51 #endif |
| (...skipping 18 matching lines...) Expand all Loading... |
| 69 enum AutoConfirmForTest { | 70 enum AutoConfirmForTest { |
| 70 DO_NOT_SKIP = 0, | 71 DO_NOT_SKIP = 0, |
| 71 PROCEED, | 72 PROCEED, |
| 72 ABORT | 73 ABORT |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 AutoConfirmForTest auto_confirm_for_test = DO_NOT_SKIP; | 76 AutoConfirmForTest auto_confirm_for_test = DO_NOT_SKIP; |
| 76 | 77 |
| 77 std::vector<std::string> CreateWarningsList(const Extension* extension) { | 78 std::vector<std::string> CreateWarningsList(const Extension* extension) { |
| 78 std::vector<std::string> warnings_list; | 79 std::vector<std::string> warnings_list; |
| 79 PermissionMessages warnings = extension->GetPermissionMessages(); | 80 PermissionMessages warnings = |
| 81 PermissionsData::GetPermissionMessages(extension); |
| 80 for (PermissionMessages::const_iterator iter = warnings.begin(); | 82 for (PermissionMessages::const_iterator iter = warnings.begin(); |
| 81 iter != warnings.end(); ++iter) { | 83 iter != warnings.end(); ++iter) { |
| 82 warnings_list.push_back(UTF16ToUTF8(iter->message())); | 84 warnings_list.push_back(UTF16ToUTF8(iter->message())); |
| 83 } | 85 } |
| 84 | 86 |
| 85 return warnings_list; | 87 return warnings_list; |
| 86 } | 88 } |
| 87 | 89 |
| 88 scoped_ptr<management::ExtensionInfo> CreateExtensionInfo( | 90 scoped_ptr<management::ExtensionInfo> CreateExtensionInfo( |
| 89 const Extension& extension, | 91 const Extension& extension, |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { | 716 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { |
| 715 return &g_factory.Get(); | 717 return &g_factory.Get(); |
| 716 } | 718 } |
| 717 | 719 |
| 718 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 720 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 719 management_event_router_.reset(new ManagementEventRouter(profile_)); | 721 management_event_router_.reset(new ManagementEventRouter(profile_)); |
| 720 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 722 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
| 721 } | 723 } |
| 722 | 724 |
| 723 } // namespace extensions | 725 } // namespace extensions |
| OLD | NEW |