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

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

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
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"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/file_util.h" 12 #include "base/file_util.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "chrome/browser/ui/chrome_select_file_policy.h" 15 #include "chrome/browser/ui/chrome_select_file_policy.h"
16 #include "chrome/common/net/x509_certificate_model.h" 16 #include "chrome/common/net/x509_certificate_model.h"
17 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
18 #include "grit/generated_resources.h" 18 #include "grit/generated_resources.h"
19 #include "ui/base/l10n/l10n_util.h" 19 #include "ui/base/l10n/l10n_util.h"
20 #include "ui/shell_dialogs/select_file_dialog.h" 20 #include "ui/shell_dialogs/select_file_dialog.h"
21 21
22 using content::BrowserThread; 22 using content::BrowserThread;
23 using content::WebContents; 23 using content::WebContents;
24 24
25 namespace { 25 namespace {
26 26
27 void WriterCallback(const base::FilePath& path, const std::string& data) { 27 void WriterCallback(const base::FilePath& path, const std::string& data) {
28 int bytes_written = file_util::WriteFile(path, data.data(), data.size()); 28 int bytes_written = base::WriteFile(path, data.data(), data.size());
29 if (bytes_written != static_cast<ssize_t>(data.size())) { 29 if (bytes_written != static_cast<ssize_t>(data.size())) {
30 LOG(ERROR) << "Writing " << path.value() << " (" 30 LOG(ERROR) << "Writing " << path.value() << " ("
31 << data.size() << "B) returned " << bytes_written; 31 << data.size() << "B) returned " << bytes_written;
32 } 32 }
33 } 33 }
34 34
35 void WriteFileOnFileThread(const base::FilePath& path, 35 void WriteFileOnFileThread(const base::FilePath& path,
36 const std::string& data) { 36 const std::string& data) {
37 BrowserThread::PostTask( 37 BrowserThread::PostTask(
38 BrowserThread::FILE, FROM_HERE, base::Bind(&WriterCallback, path, data)); 38 BrowserThread::FILE, FROM_HERE, base::Bind(&WriterCallback, path, data));
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 1, // 1-based index for |file_type_info.extensions| to specify default. 172 1, // 1-based index for |file_type_info.extensions| to specify default.
173 FILE_PATH_LITERAL("crt"), 173 FILE_PATH_LITERAL("crt"),
174 parent, params); 174 parent, params);
175 } 175 }
176 176
177 void ShowCertExportDialog(WebContents* web_contents, 177 void ShowCertExportDialog(WebContents* web_contents,
178 gfx::NativeWindow parent, 178 gfx::NativeWindow parent,
179 net::X509Certificate::OSCertHandle cert) { 179 net::X509Certificate::OSCertHandle cert) {
180 new Exporter(web_contents, parent, cert); 180 new Exporter(web_contents, parent, cert);
181 } 181 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/screenshot_taker.cc ('k') | chrome/browser/ui/libgtk2ui/app_indicator_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698