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