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/api/management/management_api.h" | 5 #include "chrome/browser/extensions/api/management/management_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 // showing. Do nothing in that case. | 645 // showing. Do nothing in that case. |
646 ExtensionRegistry* registry = ExtensionRegistry::Get(GetProfile()); | 646 ExtensionRegistry* registry = ExtensionRegistry::Get(GetProfile()); |
647 const Extension* extension = registry->GetExtensionById( | 647 const Extension* extension = registry->GetExtensionById( |
648 extension_id_, ExtensionRegistry::EVERYTHING); | 648 extension_id_, ExtensionRegistry::EVERYTHING); |
649 if (!extension) { | 649 if (!extension) { |
650 error_ = ErrorUtils::FormatErrorMessage(keys::kNoExtensionError, | 650 error_ = ErrorUtils::FormatErrorMessage(keys::kNoExtensionError, |
651 extension_id_); | 651 extension_id_); |
652 SendResponse(false); | 652 SendResponse(false); |
653 } else { | 653 } else { |
654 bool success = service()->UninstallExtension( | 654 bool success = service()->UninstallExtension( |
655 extension_id_, extensions::UNINSTALL_REASON_MANAGEMENT_API, NULL); | 655 extension_id_, |
| 656 extensions::UNINSTALL_REASON_MANAGEMENT_API, |
| 657 base::Bind(&base::DoNothing), |
| 658 NULL); |
656 | 659 |
657 // TODO set error_ if !success | 660 // TODO set error_ if !success |
658 SendResponse(success); | 661 SendResponse(success); |
659 } | 662 } |
660 } else { | 663 } else { |
661 error_ = ErrorUtils::FormatErrorMessage( | 664 error_ = ErrorUtils::FormatErrorMessage( |
662 keys::kUninstallCanceledError, extension_id_); | 665 keys::kUninstallCanceledError, extension_id_); |
663 SendResponse(false); | 666 SendResponse(false); |
664 } | 667 } |
665 } | 668 } |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 ManagementAPI::GetFactoryInstance() { | 1006 ManagementAPI::GetFactoryInstance() { |
1004 return g_factory.Pointer(); | 1007 return g_factory.Pointer(); |
1005 } | 1008 } |
1006 | 1009 |
1007 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 1010 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
1008 management_event_router_.reset(new ManagementEventRouter(browser_context_)); | 1011 management_event_router_.reset(new ManagementEventRouter(browser_context_)); |
1009 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 1012 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
1010 } | 1013 } |
1011 | 1014 |
1012 } // namespace extensions | 1015 } // namespace extensions |
OLD | NEW |