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

Side by Side Diff: chrome/browser/printing/cloud_print/cloud_print_proxy_service.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 "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" 5 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
6 6
7 #include <stack> 7 #include <stack>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return true; 118 return true;
119 } 119 }
120 120
121 void CloudPrintProxyService::GetPrintersAvalibleForRegistration( 121 void CloudPrintProxyService::GetPrintersAvalibleForRegistration(
122 std::vector<std::string>* printers) { 122 std::vector<std::string>* printers) {
123 base::FilePath list_path( 123 base::FilePath list_path(
124 CommandLine::ForCurrentProcess()->GetSwitchValuePath( 124 CommandLine::ForCurrentProcess()->GetSwitchValuePath(
125 switches::kCloudPrintSetupProxy)); 125 switches::kCloudPrintSetupProxy));
126 if (!list_path.empty()) { 126 if (!list_path.empty()) {
127 std::string printers_json; 127 std::string printers_json;
128 file_util::ReadFileToString(list_path, &printers_json); 128 base::ReadFileToString(list_path, &printers_json);
129 scoped_ptr<Value> value(base::JSONReader::Read(printers_json)); 129 scoped_ptr<Value> value(base::JSONReader::Read(printers_json));
130 base::ListValue* list = NULL; 130 base::ListValue* list = NULL;
131 if (value && value->GetAsList(&list) && list) { 131 if (value && value->GetAsList(&list) && list) {
132 for (size_t i = 0; i < list->GetSize(); ++i) { 132 for (size_t i = 0; i < list->GetSize(); ++i) {
133 std::string printer; 133 std::string printer;
134 if (list->GetString(i, &printer)) 134 if (list->GetString(i, &printer))
135 printers->push_back(printer); 135 printers->push_back(printer);
136 } 136 }
137 } 137 }
138 } else { 138 } else {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 190
191 bool CloudPrintProxyService::InvokeServiceTask(const base::Closure& task) { 191 bool CloudPrintProxyService::InvokeServiceTask(const base::Closure& task) {
192 GetServiceProcessControl()->Launch(task, base::Closure()); 192 GetServiceProcessControl()->Launch(task, base::Closure());
193 return true; 193 return true;
194 } 194 }
195 195
196 ServiceProcessControl* CloudPrintProxyService::GetServiceProcessControl() { 196 ServiceProcessControl* CloudPrintProxyService::GetServiceProcessControl() {
197 return ServiceProcessControl::GetInstance(); 197 return ServiceProcessControl::GetInstance();
198 } 198 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_prefs_browsertest.cc ('k') | chrome/browser/printing/print_dialog_cloud.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698