OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/gcp20/prototype/printer.h" | 5 #include "cloud_print/gcp20/prototype/printer.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 return; | 186 return; |
187 dns_server_.Shutdown(); | 187 dns_server_.Shutdown(); |
188 http_server_.Shutdown(); | 188 http_server_.Shutdown(); |
189 requester_.reset(); | 189 requester_.reset(); |
190 print_job_handler_.reset(); | 190 print_job_handler_.reset(); |
191 xmpp_listener_.reset(); | 191 xmpp_listener_.reset(); |
192 } | 192 } |
193 | 193 |
194 std::string Printer::GetRawCdd() { | 194 std::string Printer::GetRawCdd() { |
195 std::string json_str; | 195 std::string json_str; |
196 base::JSONWriter::WriteWithOptions(&GetCapabilities(), | 196 base::JSONWriter::WriteWithOptions(GetCapabilities(), |
197 base::JSONWriter::OPTIONS_PRETTY_PRINT, | 197 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
198 &json_str); | 198 &json_str); |
199 return json_str; | 199 return json_str; |
200 } | 200 } |
201 | 201 |
202 void Printer::OnAuthError() { | 202 void Printer::OnAuthError() { |
203 LOG(ERROR) << "Auth error occurred"; | 203 LOG(ERROR) << "Auth error occurred"; |
204 state_.access_token_update = base::Time(); | 204 state_.access_token_update = base::Time(); |
205 FallOffline(true); | 205 FallOffline(true); |
206 } | 206 } |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 | 956 |
957 dns_server_.UpdateMetadata(CreateTxt()); | 957 dns_server_.UpdateMetadata(CreateTxt()); |
958 | 958 |
959 if (connection_state_ == OFFLINE) { | 959 if (connection_state_ == OFFLINE) { |
960 requester_.reset(); | 960 requester_.reset(); |
961 xmpp_listener_.reset(); | 961 xmpp_listener_.reset(); |
962 } | 962 } |
963 | 963 |
964 return true; | 964 return true; |
965 } | 965 } |
OLD | NEW |