Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1002)

Unified Diff: chrome/browser/ui/webui/options/certificate_manager_handler.cc

Issue 2606293002: Remove ScopedVector from chrome/browser/ui. (Closed)
Patch Set: view Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/certificate_manager_handler.cc
diff --git a/chrome/browser/ui/webui/options/certificate_manager_handler.cc b/chrome/browser/ui/webui/options/certificate_manager_handler.cc
index 89edbb77eef7dd120ff126379f17a9b0e2cf25f2..f309acc8d3aab3cfd8cf52e903aa8e59af4a934d 100644
--- a/chrome/browser/ui/webui/options/certificate_manager_handler.cc
+++ b/chrome/browser/ui/webui/options/certificate_manager_handler.cc
@@ -18,7 +18,7 @@
#include "base/i18n/string_compare.h"
#include "base/id_map.h"
#include "base/macros.h"
-#include "base/memory/scoped_vector.h"
+#include "base/memory/ptr_util.h"
#include "base/posix/safe_strerror.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
@@ -1192,14 +1192,18 @@ void CertificateManagerHandler::PopulateTree(
void CertificateManagerHandler::ShowError(const std::string& title,
const std::string& error) const {
- ScopedVector<const base::Value> args;
- args.push_back(new base::StringValue(title));
- args.push_back(new base::StringValue(error));
- args.push_back(new base::StringValue(l10n_util::GetStringUTF8(IDS_OK)));
- args.push_back(base::Value::CreateNullValue().release()); // cancelTitle
- args.push_back(base::Value::CreateNullValue().release()); // okCallback
- args.push_back(base::Value::CreateNullValue().release()); // cancelCallback
- web_ui()->CallJavascriptFunctionUnsafe("AlertOverlay.show", args.get());
+ std::vector<std::unique_ptr<base::Value>> args;
Nico 2017/01/03 18:12:35 Hey, looks like http://chromium-cpp.appspot.com/ n
Avi (use Gerrit) 2017/01/03 22:54:53 :(
+ args.push_back(base::MakeUnique<base::StringValue>(title));
+ args.push_back(base::MakeUnique<base::StringValue>(error));
+ args.push_back(
+ base::MakeUnique<base::StringValue>(l10n_util::GetStringUTF8(IDS_OK)));
+ args.push_back(base::Value::CreateNullValue()); // cancelTitle
+ args.push_back(base::Value::CreateNullValue()); // okCallback
+ args.push_back(base::Value::CreateNullValue()); // cancelCallback
+ std::vector<const base::Value*> arg_ptrs;
+ for (const auto& arg : args)
+ arg_ptrs.push_back(arg.get());
Nico 2017/01/03 18:12:35 Is there any value in having args be vector? Maybe
Avi (use Gerrit) 2017/01/03 22:54:53 Done.
+ web_ui()->CallJavascriptFunctionUnsafe("AlertOverlay.show", arg_ptrs);
}
void CertificateManagerHandler::ShowImportErrors(

Powered by Google App Engine
This is Rietveld 408576698