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/extension_management_api.h" | 5 #include "chrome/browser/extensions/extension_management_api.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 #include "chrome/browser/extensions/extension_event_names.h" | 16 #include "chrome/browser/extensions/event_names.h" |
17 #include "chrome/browser/extensions/extension_event_router.h" | 17 #include "chrome/browser/extensions/event_router.h" |
18 #include "chrome/browser/extensions/extension_management_api_constants.h" | 18 #include "chrome/browser/extensions/extension_management_api_constants.h" |
19 #include "chrome/browser/extensions/extension_service.h" | 19 #include "chrome/browser/extensions/extension_service.h" |
20 #include "chrome/browser/extensions/extension_system.h" | 20 #include "chrome/browser/extensions/extension_system.h" |
21 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 21 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
22 #include "chrome/browser/extensions/management_policy.h" | 22 #include "chrome/browser/extensions/management_policy.h" |
23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/browser/ui/extensions/application_launch.h" | 24 #include "chrome/browser/ui/extensions/application_launch.h" |
25 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 25 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
26 #include "chrome/common/chrome_notification_types.h" | 26 #include "chrome/common/chrome_notification_types.h" |
27 #include "chrome/common/chrome_utility_messages.h" | 27 #include "chrome/common/chrome_utility_messages.h" |
(...skipping 11 matching lines...) Expand all Loading... |
39 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 39 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
40 #endif | 40 #endif |
41 | 41 |
42 using base::IntToString; | 42 using base::IntToString; |
43 using content::BrowserThread; | 43 using content::BrowserThread; |
44 using content::UtilityProcessHost; | 44 using content::UtilityProcessHost; |
45 using content::UtilityProcessHostClient; | 45 using content::UtilityProcessHostClient; |
46 using extensions::Extension; | 46 using extensions::Extension; |
47 using extensions::PermissionMessages; | 47 using extensions::PermissionMessages; |
48 | 48 |
49 namespace events = extension_event_names; | 49 namespace events = extensions::event_names; |
50 namespace keys = extension_management_api_constants; | 50 namespace keys = extension_management_api_constants; |
51 | 51 |
52 namespace { | 52 namespace { |
53 | 53 |
54 enum AutoConfirmForTest { | 54 enum AutoConfirmForTest { |
55 DO_NOT_SKIP = 0, | 55 DO_NOT_SKIP = 0, |
56 PROCEED, | 56 PROCEED, |
57 ABORT | 57 ABORT |
58 }; | 58 }; |
59 | 59 |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 ExtensionService* service = profile->GetExtensionService(); | 585 ExtensionService* service = profile->GetExtensionService(); |
586 args.Append(CreateExtensionInfo(*extension, service)); | 586 args.Append(CreateExtensionInfo(*extension, service)); |
587 } | 587 } |
588 | 588 |
589 std::string args_json; | 589 std::string args_json; |
590 base::JSONWriter::Write(&args, &args_json); | 590 base::JSONWriter::Write(&args, &args_json); |
591 | 591 |
592 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 592 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
593 event_name, args_json, NULL, GURL(), extensions::EventFilteringInfo()); | 593 event_name, args_json, NULL, GURL(), extensions::EventFilteringInfo()); |
594 } | 594 } |
OLD | NEW |