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/service/cloud_print/cloud_print_proxy.h" | 5 #include "chrome/service/cloud_print/cloud_print_proxy.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 } | 221 } |
222 | 222 |
223 void CloudPrintProxy::OnUnregisterPrinters( | 223 void CloudPrintProxy::OnUnregisterPrinters( |
224 const std::string& auth_token, | 224 const std::string& auth_token, |
225 const std::list<std::string>& printer_ids) { | 225 const std::list<std::string>& printer_ids) { |
226 UMA_HISTOGRAM_COUNTS_10000("CloudPrint.UnregisterPrinters", | 226 UMA_HISTOGRAM_COUNTS_10000("CloudPrint.UnregisterPrinters", |
227 printer_ids.size()); | 227 printer_ids.size()); |
228 ShutdownBackend(); | 228 ShutdownBackend(); |
229 ConnectorSettings settings; | 229 ConnectorSettings settings; |
230 settings.InitFrom(service_prefs_); | 230 settings.InitFrom(service_prefs_); |
231 wipeout_.reset(new CloudPrintWipeout(this, settings.server_url())); | 231 net::PartialNetworkTrafficAnnotationTag partial_traffic_annotation = |
232 net::DefinePartialNetworkTrafficAnnotation("cloud_print_proxy", | |
233 "cloud_print", R"( | |
234 semantics { | |
235 description: | |
236 "Sends a request to Cloud Print to unregister one or more " | |
237 "printers." | |
238 trigger: | |
239 "User request of unregistering printers or a change of an admin " | |
240 "policy regarding Cloud Print." | |
241 data: "OAuth2 token and list of parinter ids to unregister." | |
Scott Byer
2017/06/16 16:09:21
nit: spelling
Ramin Halavati
2017/06/16 16:32:06
Done.
| |
242 })"); | |
243 wipeout_.reset(new CloudPrintWipeout(this, settings.server_url(), | |
244 partial_traffic_annotation)); | |
232 wipeout_->UnregisterPrinters(auth_token, printer_ids); | 245 wipeout_->UnregisterPrinters(auth_token, printer_ids); |
233 } | 246 } |
234 | 247 |
235 void CloudPrintProxy::OnXmppPingUpdated(int ping_timeout) { | 248 void CloudPrintProxy::OnXmppPingUpdated(int ping_timeout) { |
236 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | 249 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
237 service_prefs_->SetInt(prefs::kCloudPrintXmppPingTimeout, ping_timeout); | 250 service_prefs_->SetInt(prefs::kCloudPrintXmppPingTimeout, ping_timeout); |
238 service_prefs_->WritePrefs(); | 251 service_prefs_->WritePrefs(); |
239 } | 252 } |
240 | 253 |
241 void CloudPrintProxy::OnUnregisterPrintersComplete() { | 254 void CloudPrintProxy::OnUnregisterPrintersComplete() { |
242 wipeout_.reset(); | 255 wipeout_.reset(); |
243 // Finish disabling cloud print for this user. | 256 // Finish disabling cloud print for this user. |
244 DisableForUser(); | 257 DisableForUser(); |
245 } | 258 } |
246 | 259 |
247 void CloudPrintProxy::ShutdownBackend() { | 260 void CloudPrintProxy::ShutdownBackend() { |
248 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | 261 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
249 if (backend_.get()) | 262 if (backend_.get()) |
250 backend_->Shutdown(); | 263 backend_->Shutdown(); |
251 backend_.reset(); | 264 backend_.reset(); |
252 } | 265 } |
253 | 266 |
254 } // namespace cloud_print | 267 } // namespace cloud_print |
OLD | NEW |