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/print_job_handler.h" | 5 #include "cloud_print/gcp20/prototype/print_job_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 const int kTooManyDraftsTimeout = 10; | 28 const int kTooManyDraftsTimeout = 10; |
29 const size_t kMaxDrafts = 5; | 29 const size_t kMaxDrafts = 5; |
30 | 30 |
31 const base::FilePath::CharType kJobsPath[] = FILE_PATH_LITERAL("printjobs"); | 31 const base::FilePath::CharType kJobsPath[] = FILE_PATH_LITERAL("printjobs"); |
32 | 32 |
33 bool ValidateTicket(const std::string& ticket) { | 33 bool ValidateTicket(const std::string& ticket) { |
34 return true; | 34 return true; |
35 } | 35 } |
36 | 36 |
37 std::string GenerateId() { | 37 std::string GenerateId() { |
38 return base::StringToLowerASCII(base::GenerateGUID()); | 38 return base::ToLowerASCII(base::GenerateGUID()); |
39 } | 39 } |
40 | 40 |
41 } // namespace | 41 } // namespace |
42 | 42 |
43 struct PrintJobHandler::LocalPrintJobExtended { | 43 struct PrintJobHandler::LocalPrintJobExtended { |
44 LocalPrintJobExtended(const LocalPrintJob& job, const std::string& ticket) | 44 LocalPrintJobExtended(const LocalPrintJob& job, const std::string& ticket) |
45 : data(job), | 45 : data(job), |
46 ticket(ticket), | 46 ticket(ticket), |
47 state(LocalPrintJob::STATE_DRAFT) {} | 47 state(LocalPrintJob::STATE_DRAFT) {} |
48 LocalPrintJobExtended() : state(LocalPrintJob::STATE_DRAFT) {} | 48 LocalPrintJobExtended() : state(LocalPrintJob::STATE_DRAFT) {} |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 return expiration - base::Time::Now(); | 301 return expiration - base::Time::Now(); |
302 } | 302 } |
303 | 303 |
304 void PrintJobHandler::ForgetDraft(const std::string& id) { | 304 void PrintJobHandler::ForgetDraft(const std::string& id) { |
305 drafts.erase(id); | 305 drafts.erase(id); |
306 } | 306 } |
307 | 307 |
308 void PrintJobHandler::ForgetLocalJob(const std::string& id) { | 308 void PrintJobHandler::ForgetLocalJob(const std::string& id) { |
309 jobs.erase(id); | 309 jobs.erase(id); |
310 } | 310 } |
OLD | NEW |