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_PRINTERS_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_PRINTING_PRINTERS_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_PRINTING_PRINTERS_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_PRINTING_PRINTERS_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 // forbidden. | 69 // forbidden. |
70 void AddObserver(PrintersManager::Observer* observer); | 70 void AddObserver(PrintersManager::Observer* observer); |
71 | 71 |
72 // Remove |observer| so that it no longer receives notifications. After the | 72 // Remove |observer| so that it no longer receives notifications. After the |
73 // completion of this method, the |observer| can be safely destroyed. | 73 // completion of this method, the |observer| can be safely destroyed. |
74 void RemoveObserver(PrintersManager::Observer* observer); | 74 void RemoveObserver(PrintersManager::Observer* observer); |
75 | 75 |
76 // Returns a ModelTypeSyncBridge for the sync client. | 76 // Returns a ModelTypeSyncBridge for the sync client. |
77 PrintersSyncBridge* GetSyncBridge(); | 77 PrintersSyncBridge* GetSyncBridge(); |
78 | 78 |
79 // Registers that the printer was installed in CUPS. | |
80 void PrinterInstalled(const Printer& printer); | |
81 | |
82 // Returns true if the printer is installed in CUPS. | |
83 bool IsConfigurationCurrent(const Printer& printer); | |
84 | |
79 private: | 85 private: |
80 // Updates the in-memory recommended printer list. | 86 // Updates the in-memory recommended printer list. |
81 void UpdateRecommendedPrinters(); | 87 void UpdateRecommendedPrinters(); |
82 | 88 |
83 Profile* profile_; | 89 Profile* profile_; |
84 PrefChangeRegistrar pref_change_registrar_; | 90 PrefChangeRegistrar pref_change_registrar_; |
85 | 91 |
86 // The backend for profile printers. | 92 // The backend for profile printers. |
87 std::unique_ptr<PrintersSyncBridge> sync_bridge_; | 93 std::unique_ptr<PrintersSyncBridge> sync_bridge_; |
88 | 94 |
89 // Contains the keys for all recommended printers in order so we can return | 95 // Contains the keys for all recommended printers in order so we can return |
90 // the list of recommended printers in the order they were received. | 96 // the list of recommended printers in the order they were received. |
91 std::vector<std::string> recommended_printer_ids_; | 97 std::vector<std::string> recommended_printer_ids_; |
92 std::map<std::string, std::unique_ptr<base::DictionaryValue>> | 98 std::map<std::string, std::unique_ptr<Printer>> recommended_printers_; |
93 recommended_printers_; | 99 |
100 // Map of printer ids to installation timestpamps. | |
Carlson
2017/05/05 23:59:16
timestamps
skau
2017/05/08 18:38:02
Done.
| |
101 std::map<std::string, int64_t> installed_printer_timestamps_; | |
Carlson
2017/05/05 23:59:16
why int64_t instead of base::Time?
skau
2017/05/08 18:38:02
I didn't think about it. It's time all the way dow
| |
94 | 102 |
95 base::ObserverList<Observer> observers_; | 103 base::ObserverList<Observer> observers_; |
96 | 104 |
97 DISALLOW_COPY_AND_ASSIGN(PrintersManager); | 105 DISALLOW_COPY_AND_ASSIGN(PrintersManager); |
98 }; | 106 }; |
99 | 107 |
100 } // namespace chromeos | 108 } // namespace chromeos |
101 | 109 |
102 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_PRINTERS_MANAGER_H_ | 110 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_PRINTERS_MANAGER_H_ |
OLD | NEW |