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

Side by Side Diff: cloud_print/service/win/chrome_launcher.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 "cloud_print/service/win/chrome_launcher.h" 5 #include "cloud_print/service/win/chrome_launcher.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 url = net::AppendQueryParameter(url, "service", "cloudprint"); 108 url = net::AppendQueryParameter(url, "service", "cloudprint");
109 url = net::AppendQueryParameter(url, "sarp", "1"); 109 url = net::AppendQueryParameter(url, "sarp", "1");
110 return net::AppendQueryParameter( 110 return net::AppendQueryParameter(
111 url, "continue", GetCloudPrintServiceEnableURL(proxy_id).spec()); 111 url, "continue", GetCloudPrintServiceEnableURL(proxy_id).spec());
112 } 112 }
113 113
114 std::string ReadAndUpdateServiceState(const base::FilePath& directory, 114 std::string ReadAndUpdateServiceState(const base::FilePath& directory,
115 const std::string& proxy_id) { 115 const std::string& proxy_id) {
116 std::string json; 116 std::string json;
117 base::FilePath file_path = directory.Append(chrome::kServiceStateFileName); 117 base::FilePath file_path = directory.Append(chrome::kServiceStateFileName);
118 if (!file_util::ReadFileToString(file_path, &json)) { 118 if (!base::ReadFileToString(file_path, &json)) {
119 return std::string(); 119 return std::string();
120 } 120 }
121 121
122 scoped_ptr<base::Value> service_state(base::JSONReader::Read(json)); 122 scoped_ptr<base::Value> service_state(base::JSONReader::Read(json));
123 base::DictionaryValue* dictionary = NULL; 123 base::DictionaryValue* dictionary = NULL;
124 if (!service_state->GetAsDictionary(&dictionary) || !dictionary) { 124 if (!service_state->GetAsDictionary(&dictionary) || !dictionary) {
125 return std::string(); 125 return std::string();
126 } 126 }
127 127
128 bool enabled = false; 128 bool enabled = false;
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 } 337 }
338 } else { 338 } else {
339 LOG(ERROR) << "Chrome launch failed."; 339 LOG(ERROR) << "Chrome launch failed.";
340 return result; 340 return result;
341 } 341 }
342 } 342 }
343 NOTREACHED(); 343 NOTREACHED();
344 return std::string(); 344 return std::string();
345 } 345 }
346 346
OLDNEW
« no previous file with comments | « cloud_print/gcp20/prototype/printer_state.cc ('k') | cloud_print/service/win/cloud_print_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698