Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: chromeos/printing/printer_configuration.h

Issue 2858353004: Track printer installations for each configuration. (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/printing/printer_configuration.h
diff --git a/chromeos/printing/printer_configuration.h b/chromeos/printing/printer_configuration.h
index 27f047bdb93e39bca6b49c6b55131a04df2dc48a..cac44c16d437a69154d647fa78a831dbd9c5572d 100644
--- a/chromeos/printing/printer_configuration.h
+++ b/chromeos/printing/printer_configuration.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/macros.h"
+#include "base/time/time.h"
#include "chromeos/chromeos_export.h"
namespace chromeos {
@@ -46,8 +47,8 @@ class CHROMEOS_EXPORT Printer {
// Constructs a printer object that is completely empty.
Printer();
- // Constructs a printer object with an id.
- explicit Printer(const std::string& id);
+ // Constructs a printer object with an |id| and a |last_updated| timestamp.
+ explicit Printer(const std::string& id, const base::Time& last_updated = {});
// Copy constructor and assignment.
Printer(const Printer& printer);
@@ -93,6 +94,10 @@ class CHROMEOS_EXPORT Printer {
Source source() const { return source_; }
void set_source(const Source source) { source_ = source; }
+ // Returns the timestamp for the most recent update. Returns 0 if the
+ // printer was not created with a valid timestamp.
+ base::Time last_updated() const { return last_updated_; }
+
private:
// Globally unique identifier. Empty indicates a new printer.
std::string id_;
@@ -121,6 +126,9 @@ class CHROMEOS_EXPORT Printer {
// The datastore which holds this printer.
Source source_;
+
+ // Timestamp of most recent change.
+ base::Time last_updated_;
};
} // namespace chromeos
« no previous file with comments | « chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc ('k') | chromeos/printing/printer_configuration.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698