| 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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 ->UserMayModifySettings(target_extension, NULL)) { | 604 ->UserMayModifySettings(target_extension, NULL)) { |
| 605 error_ = ErrorUtils::FormatErrorMessage( | 605 error_ = ErrorUtils::FormatErrorMessage( |
| 606 keys::kUserCantModifyError, extension_id_); | 606 keys::kUserCantModifyError, extension_id_); |
| 607 return false; | 607 return false; |
| 608 } | 608 } |
| 609 | 609 |
| 610 if (auto_confirm_for_test == DO_NOT_SKIP) { | 610 if (auto_confirm_for_test == DO_NOT_SKIP) { |
| 611 if (show_confirm_dialog) { | 611 if (show_confirm_dialog) { |
| 612 AddRef(); // Balanced in ExtensionUninstallAccepted/Canceled | 612 AddRef(); // Balanced in ExtensionUninstallAccepted/Canceled |
| 613 extension_uninstall_dialog_.reset(ExtensionUninstallDialog::Create( | 613 extension_uninstall_dialog_.reset(ExtensionUninstallDialog::Create( |
| 614 GetProfile(), GetCurrentBrowser(), this)); | 614 GetProfile(), |
| 615 chrome::FindWindowForBrowser(GetCurrentBrowser()), |
| 616 this)); |
| 615 if (extension_id() != target_extension_id) { | 617 if (extension_id() != target_extension_id) { |
| 616 extension_uninstall_dialog_->ConfirmProgrammaticUninstall( | 618 extension_uninstall_dialog_->ConfirmProgrammaticUninstall( |
| 617 target_extension, GetExtension()); | 619 target_extension, GetExtension()); |
| 618 } else { | 620 } else { |
| 619 // If this is a self uninstall, show the generic uninstall dialog. | 621 // If this is a self uninstall, show the generic uninstall dialog. |
| 620 extension_uninstall_dialog_->ConfirmUninstall(target_extension); | 622 extension_uninstall_dialog_->ConfirmUninstall(target_extension); |
| 621 } | 623 } |
| 622 } else { | 624 } else { |
| 623 Finish(true); | 625 Finish(true); |
| 624 } | 626 } |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 ManagementAPI::GetFactoryInstance() { | 1001 ManagementAPI::GetFactoryInstance() { |
| 1000 return g_factory.Pointer(); | 1002 return g_factory.Pointer(); |
| 1001 } | 1003 } |
| 1002 | 1004 |
| 1003 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 1005 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 1004 management_event_router_.reset(new ManagementEventRouter(browser_context_)); | 1006 management_event_router_.reset(new ManagementEventRouter(browser_context_)); |
| 1005 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 1007 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 1006 } | 1008 } |
| 1007 | 1009 |
| 1008 } // namespace extensions | 1010 } // namespace extensions |
| OLD | NEW |