| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.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/extension_event_names.h" |
| 17 #include "chrome/browser/extensions/extension_event_router.h" | 17 #include "chrome/browser/extensions/extension_event_router.h" |
| 18 #include "chrome/browser/extensions/extension_service.h" | 18 #include "chrome/browser/extensions/extension_service.h" |
| 19 #include "chrome/browser/extensions/extension_updater.h" | 19 #include "chrome/browser/extensions/extension_updater.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
| 22 #include "chrome/browser/ui/webui/extension_icon_source.h" | 22 #include "chrome/browser/ui/webui/extension_icon_source.h" |
| 23 #include "chrome/common/chrome_notification_types.h" | 23 #include "chrome/common/chrome_notification_types.h" |
| 24 #include "chrome/common/chrome_utility_messages.h" | 24 #include "chrome/common/chrome_utility_messages.h" |
| 25 #include "chrome/common/extensions/extension.h" | 25 #include "chrome/common/extensions/extension.h" |
| 26 #include "chrome/common/extensions/extension_constants.h" | 26 #include "chrome/common/extensions/extension_constants.h" |
| 27 #include "chrome/common/extensions/extension_error_utils.h" | 27 #include "chrome/common/extensions/extension_error_utils.h" |
| 28 #include "chrome/common/extensions/extension_icon_set.h" | 28 #include "chrome/common/extensions/extension_icon_set.h" |
| 29 #include "chrome/common/extensions/url_pattern.h" | 29 #include "chrome/common/extensions/url_pattern.h" |
| 30 #include "content/common/notification_service.h" | 30 #include "content/public/browser/notification_details.h" |
| 31 #include "content/public/browser/notification_source.h" |
| 31 | 32 |
| 32 using base::IntToString; | 33 using base::IntToString; |
| 33 namespace events = extension_event_names; | 34 namespace events = extension_event_names; |
| 34 | 35 |
| 35 namespace { | 36 namespace { |
| 36 | 37 |
| 37 const char kAppLaunchUrlKey[] = "appLaunchUrl"; | 38 const char kAppLaunchUrlKey[] = "appLaunchUrl"; |
| 38 const char kDescriptionKey[] = "description"; | 39 const char kDescriptionKey[] = "description"; |
| 39 const char kEnabledKey[] = "enabled"; | 40 const char kEnabledKey[] = "enabled"; |
| 40 const char kHomepageUrlKey[] = "homepageUrl"; | 41 const char kHomepageUrlKey[] = "homepageUrl"; |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 bool enabled = service->GetExtensionById(extension->id(), false) != NULL; | 479 bool enabled = service->GetExtensionById(extension->id(), false) != NULL; |
| 479 args.Append(CreateExtensionInfo(*extension, enabled)); | 480 args.Append(CreateExtensionInfo(*extension, enabled)); |
| 480 } | 481 } |
| 481 | 482 |
| 482 std::string args_json; | 483 std::string args_json; |
| 483 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); | 484 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); |
| 484 | 485 |
| 485 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 486 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
| 486 event_name, args_json, NULL, GURL()); | 487 event_name, args_json, NULL, GURL()); |
| 487 } | 488 } |
| OLD | NEW |