| 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/ui/webui/extensions/extension_settings_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 if (!extension_id_prompting_.empty()) | 777 if (!extension_id_prompting_.empty()) |
| 778 return; // Only one prompt at a time. | 778 return; // Only one prompt at a time. |
| 779 | 779 |
| 780 extension_id_prompting_ = extension_id; | 780 extension_id_prompting_ = extension_id; |
| 781 | 781 |
| 782 GetExtensionUninstallDialog()->ConfirmUninstall(extension); | 782 GetExtensionUninstallDialog()->ConfirmUninstall(extension); |
| 783 } | 783 } |
| 784 | 784 |
| 785 void ExtensionSettingsHandler::HandleOptionsMessage(const ListValue* args) { | 785 void ExtensionSettingsHandler::HandleOptionsMessage(const ListValue* args) { |
| 786 const Extension* extension = GetActiveExtension(args); | 786 const Extension* extension = GetActiveExtension(args); |
| 787 if (!extension || extension->options_url().is_empty()) | 787 if (!extension || |
| 788 extensions::ManifestURL::GetOptionsPage(extension).is_empty()) |
| 788 return; | 789 return; |
| 789 extensions::ExtensionSystem::Get(Profile::FromWebUI(web_ui()))-> | 790 extensions::ExtensionSystem::Get(Profile::FromWebUI(web_ui()))-> |
| 790 process_manager()->OpenOptionsPage(extension, | 791 process_manager()->OpenOptionsPage(extension, |
| 791 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents())); | 792 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents())); |
| 792 } | 793 } |
| 793 | 794 |
| 794 void ExtensionSettingsHandler::HandleShowButtonMessage(const ListValue* args) { | 795 void ExtensionSettingsHandler::HandleShowButtonMessage(const ListValue* args) { |
| 795 const Extension* extension = GetActiveExtension(args); | 796 const Extension* extension = GetActiveExtension(args); |
| 796 if (!extension) | 797 if (!extension) |
| 797 return; | 798 return; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 std::vector<std::string> requirement_errors) { | 1004 std::vector<std::string> requirement_errors) { |
| 1004 if (requirement_errors.empty()) { | 1005 if (requirement_errors.empty()) { |
| 1005 extension_service_->EnableExtension(extension_id); | 1006 extension_service_->EnableExtension(extension_id); |
| 1006 } else { | 1007 } else { |
| 1007 ExtensionErrorReporter::GetInstance()->ReportError( | 1008 ExtensionErrorReporter::GetInstance()->ReportError( |
| 1008 UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1009 UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
| 1009 true /* be noisy */); | 1010 true /* be noisy */); |
| 1010 } | 1011 } |
| 1011 requirements_checker_.reset(); | 1012 requirements_checker_.reset(); |
| 1012 } | 1013 } |
| OLD | NEW |