| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 ++iter) { | 180 ++iter) { |
| 181 string16 warning_string( | 181 string16 warning_string( |
| 182 ExtensionWarningSet::GetLocalizedWarning(*iter)); | 182 ExtensionWarningSet::GetLocalizedWarning(*iter)); |
| 183 warnings_list->Append(Value::CreateStringValue(warning_string)); | 183 warnings_list->Append(Value::CreateStringValue(warning_string)); |
| 184 } | 184 } |
| 185 extension_data->Set("warnings", warnings_list); | 185 extension_data->Set("warnings", warnings_list); |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 | 188 |
| 189 // Add install warnings (these are not the same as warnings!). | 189 // Add install warnings (these are not the same as warnings!). |
| 190 const std::vector<std::string>& install_warnings = | 190 const Extension::InstallWarningVector& install_warnings = |
| 191 extension->install_warnings(); | 191 extension->install_warnings(); |
| 192 if (!install_warnings.empty()) { | 192 if (!install_warnings.empty()) { |
| 193 scoped_ptr<ListValue> list(new ListValue()); | 193 scoped_ptr<ListValue> list(new ListValue()); |
| 194 for (std::vector<std::string>::const_iterator it = install_warnings.begin(); | 194 for (Extension::InstallWarningVector::const_iterator it = |
| 195 it != install_warnings.end(); ++it) { | 195 install_warnings.begin(); it != install_warnings.end(); ++it) { |
| 196 list->Append(Value::CreateStringValue(*it)); | 196 DictionaryValue* item = new DictionaryValue(); |
| 197 item->SetBoolean("isHTML", |
| 198 it->format == Extension::InstallWarning::FORMAT_HTML); |
| 199 item->SetString("message", it->message); |
| 200 list->Append(item); |
| 197 } | 201 } |
| 198 extension_data->Set("installWarnings", list.release()); | 202 extension_data->Set("installWarnings", list.release()); |
| 199 } | 203 } |
| 200 | 204 |
| 201 return extension_data; | 205 return extension_data; |
| 202 } | 206 } |
| 203 | 207 |
| 204 void ExtensionSettingsHandler::GetLocalizedValues( | 208 void ExtensionSettingsHandler::GetLocalizedValues( |
| 205 DictionaryValue* localized_strings) { | 209 DictionaryValue* localized_strings) { |
| 206 localized_strings->SetString("extensionSettings", | 210 localized_strings->SetString("extensionSettings", |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 return extension_uninstall_dialog_.get(); | 850 return extension_uninstall_dialog_.get(); |
| 847 #else | 851 #else |
| 848 return NULL; | 852 return NULL; |
| 849 #endif // !defined(OS_ANDROID) | 853 #endif // !defined(OS_ANDROID) |
| 850 } | 854 } |
| 851 | 855 |
| 852 void ExtensionSettingsHandler::InspectExtensionHost(ExtensionHost* host) { | 856 void ExtensionSettingsHandler::InspectExtensionHost(ExtensionHost* host) { |
| 853 if (host) | 857 if (host) |
| 854 DevToolsWindow::OpenDevToolsWindow(host->render_view_host()); | 858 DevToolsWindow::OpenDevToolsWindow(host->render_view_host()); |
| 855 } | 859 } |
| OLD | NEW |