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

Side by Side Diff: chrome/browser/ui/certificate_dialogs.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser_tabrestore.cc ('k') | chrome/browser/ui/chrome_pages.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/certificate_dialogs.h" 5 #include "chrome/browser/ui/certificate_dialogs.h"
6 6
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 result.append("\r\n"); 45 result.append("\r\n");
46 } 46 }
47 return result; 47 return result;
48 } 48 }
49 49
50 std::string GetBase64String(net::X509Certificate::OSCertHandle cert) { 50 std::string GetBase64String(net::X509Certificate::OSCertHandle cert) {
51 std::string base64; 51 std::string base64;
52 if (!base::Base64Encode( 52 if (!base::Base64Encode(
53 x509_certificate_model::GetDerString(cert), &base64)) { 53 x509_certificate_model::GetDerString(cert), &base64)) {
54 LOG(ERROR) << "base64 encoding error"; 54 LOG(ERROR) << "base64 encoding error";
55 return ""; 55 return std::string();
56 } 56 }
57 return "-----BEGIN CERTIFICATE-----\r\n" + 57 return "-----BEGIN CERTIFICATE-----\r\n" +
58 WrapAt64(base64) + 58 WrapAt64(base64) +
59 "-----END CERTIFICATE-----\r\n"; 59 "-----END CERTIFICATE-----\r\n";
60 } 60 }
61 61
62 //////////////////////////////////////////////////////////////////////////////// 62 ////////////////////////////////////////////////////////////////////////////////
63 // General utility functions. 63 // General utility functions.
64 64
65 class Exporter : public ui::SelectFileDialog::Listener { 65 class Exporter : public ui::SelectFileDialog::Listener {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 suggested_path, &file_type_info, 1, 179 suggested_path, &file_type_info, 1,
180 FILE_PATH_LITERAL("crt"), 180 FILE_PATH_LITERAL("crt"),
181 parent, params); 181 parent, params);
182 } 182 }
183 183
184 void ShowCertExportDialog(WebContents* web_contents, 184 void ShowCertExportDialog(WebContents* web_contents,
185 gfx::NativeWindow parent, 185 gfx::NativeWindow parent,
186 net::X509Certificate::OSCertHandle cert) { 186 net::X509Certificate::OSCertHandle cert) {
187 new Exporter(web_contents, parent, cert); 187 new Exporter(web_contents, parent, cert);
188 } 188 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_tabrestore.cc ('k') | chrome/browser/ui/chrome_pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698