OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
13 #include "chrome/browser/browser.h" | 13 #include "chrome/browser/browser.h" |
14 #include "chrome/browser/extensions/extension_event_names.h" | 14 #include "chrome/browser/extensions/extension_event_names.h" |
15 #include "chrome/browser/extensions/extension_message_service.h" | 15 #include "chrome/browser/extensions/extension_message_service.h" |
16 #include "chrome/browser/extensions/extensions_service.h" | 16 #include "chrome/browser/extensions/extensions_service.h" |
| 17 #include "chrome/browser/profile.h" |
17 #include "chrome/common/extensions/extension_error_utils.h" | 18 #include "chrome/common/extensions/extension_error_utils.h" |
18 #include "chrome/common/notification_service.h" | 19 #include "chrome/common/notification_service.h" |
19 #include "chrome/common/notification_type.h" | 20 #include "chrome/common/notification_type.h" |
20 | 21 |
21 using base::IntToString; | 22 using base::IntToString; |
22 namespace events = extension_event_names; | 23 namespace events = extension_event_names; |
23 | 24 |
24 const char kAppLaunchUrlKey[] = "appLaunchUrl"; | 25 const char kAppLaunchUrlKey[] = "appLaunchUrl"; |
25 const char kEnabledKey[] = "enabled"; | 26 const char kEnabledKey[] = "enabled"; |
26 const char kIconsKey[] = "icons"; | 27 const char kIconsKey[] = "icons"; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 std::string args_json; | 197 std::string args_json; |
197 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); | 198 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); |
198 | 199 |
199 ExtensionMessageService* message_service = | 200 ExtensionMessageService* message_service = |
200 profile->GetExtensionMessageService(); | 201 profile->GetExtensionMessageService(); |
201 message_service->DispatchEventToRenderers(event_name, | 202 message_service->DispatchEventToRenderers(event_name, |
202 args_json, | 203 args_json, |
203 profile, | 204 profile, |
204 GURL()); | 205 GURL()); |
205 } | 206 } |
OLD | NEW |