| 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" |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 event_name = events::kOnExtensionDisabled; | 564 event_name = events::kOnExtensionDisabled; |
| 565 break; | 565 break; |
| 566 default: | 566 default: |
| 567 NOTREACHED(); | 567 NOTREACHED(); |
| 568 return; | 568 return; |
| 569 } | 569 } |
| 570 | 570 |
| 571 ListValue args; | 571 ListValue args; |
| 572 if (event_name == events::kOnExtensionUninstalled) { | 572 if (event_name == events::kOnExtensionUninstalled) { |
| 573 args.Append(Value::CreateStringValue( | 573 args.Append(Value::CreateStringValue( |
| 574 *content::Details<const std::string>(details).ptr())); | 574 content::Details<const extensions::Extension>(details).ptr()->id())); |
| 575 } else { | 575 } else { |
| 576 const Extension* extension = NULL; | 576 const Extension* extension = NULL; |
| 577 if (event_name == events::kOnExtensionDisabled) { | 577 if (event_name == events::kOnExtensionDisabled) { |
| 578 extension = content::Details<extensions::UnloadedExtensionInfo>( | 578 extension = content::Details<extensions::UnloadedExtensionInfo>( |
| 579 details)->extension; | 579 details)->extension; |
| 580 } else { | 580 } else { |
| 581 extension = content::Details<const Extension>(details).ptr(); | 581 extension = content::Details<const Extension>(details).ptr(); |
| 582 } | 582 } |
| 583 CHECK(extension); | 583 CHECK(extension); |
| 584 ExtensionService* service = profile->GetExtensionService(); | 584 ExtensionService* service = profile->GetExtensionService(); |
| 585 args.Append(CreateExtensionInfo(*extension, service)); | 585 args.Append(CreateExtensionInfo(*extension, service)); |
| 586 } | 586 } |
| 587 | 587 |
| 588 std::string args_json; | 588 std::string args_json; |
| 589 base::JSONWriter::Write(&args, &args_json); | 589 base::JSONWriter::Write(&args, &args_json); |
| 590 | 590 |
| 591 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 591 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
| 592 event_name, args_json, NULL, GURL(), extensions::EventFilteringInfo()); | 592 event_name, args_json, NULL, GURL(), extensions::EventFilteringInfo()); |
| 593 } | 593 } |
| OLD | NEW |