Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_H_ | 6 #define CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 | 45 |
| 46 // Returns a unique id for the print job. | 46 // Returns a unique id for the print job. |
| 47 std::string GetUniqueId() const; | 47 std::string GetUniqueId() const; |
| 48 | 48 |
| 49 // Getters. | 49 // Getters. |
| 50 const Printer& printer() const { return printer_; } | 50 const Printer& printer() const { return printer_; } |
| 51 int job_id() const { return job_id_; } | 51 int job_id() const { return job_id_; } |
| 52 const std::string& document_title() const { return document_title_; } | 52 const std::string& document_title() const { return document_title_; } |
| 53 int total_page_number() const { return total_page_number_; } | 53 int total_page_number() const { return total_page_number_; } |
| 54 int printed_page_number() const { return printed_page_number_; } | 54 int printed_page_number() const { return printed_page_number_; } |
| 55 bool expired() const { return expired_; } | |
| 55 State state() const { return state_; } | 56 State state() const { return state_; } |
| 56 ErrorCode error_code() const { return error_code_; } | 57 ErrorCode error_code() const { return error_code_; } |
| 57 | 58 |
| 58 // Setters. | 59 // Setters. |
| 59 void set_printed_page_number(int page_number) { | 60 void set_printed_page_number(int page_number) { |
| 60 printed_page_number_ = page_number; | 61 printed_page_number_ = page_number; |
| 61 } | 62 } |
| 63 void set_expired(bool expired) { expired_ = expired; } | |
| 62 void set_state(State state) { state_ = state; } | 64 void set_state(State state) { state_ = state; } |
| 63 void set_error_code(ErrorCode error_code) { error_code_ = error_code; } | 65 void set_error_code(ErrorCode error_code) { error_code_ = error_code; } |
| 64 | 66 |
| 65 // Returns true if |state_| represents a terminal state. | 67 // Returns true if |state_| represents a terminal state. |
| 66 bool IsJobFinished(); | 68 bool IsJobFinished(); |
| 67 | 69 |
| 68 private: | 70 private: |
| 69 Printer printer_; | 71 Printer printer_; |
| 70 int job_id_; | 72 int job_id_; |
| 71 | 73 |
| 72 std::string document_title_; | 74 std::string document_title_; |
| 73 int total_page_number_ = 0; | 75 int total_page_number_ = 0; |
| 74 int printed_page_number_ = 0; | 76 int printed_page_number_ = 0; |
| 75 | 77 |
| 78 // True if the job has expired due to timeout. | |
| 79 bool expired_ = false; | |
|
xdai1
2017/03/16 19:56:16
Maybe we can merge this variable to ErrorCode?
skau
2017/03/16 22:14:36
We could. But I think it'll be easier to maintain
xdai1
2017/03/16 22:56:14
Acknowledged.
| |
| 80 | |
| 76 State state_ = State::STATE_NONE; | 81 State state_ = State::STATE_NONE; |
| 77 ErrorCode error_code_ = ErrorCode::NO_ERROR; | 82 ErrorCode error_code_ = ErrorCode::NO_ERROR; |
| 78 | 83 |
| 79 DISALLOW_COPY_AND_ASSIGN(CupsPrintJob); | 84 DISALLOW_COPY_AND_ASSIGN(CupsPrintJob); |
| 80 }; | 85 }; |
| 81 | 86 |
| 82 } // namespace chromeos | 87 } // namespace chromeos |
| 83 | 88 |
| 84 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_H_ | 89 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_H_ |
| OLD | NEW |