OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |