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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 // Register the printing preferences with the |registry|. | 45 // Register the printing preferences with the |registry|. |
46 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 46 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
47 | 47 |
48 // Returns the printers that are saved in preferences. | 48 // Returns the printers that are saved in preferences. |
49 std::vector<std::unique_ptr<Printer>> GetPrinters() const; | 49 std::vector<std::unique_ptr<Printer>> GetPrinters() const; |
50 | 50 |
51 // Returns printers from enterprise policy. | 51 // Returns printers from enterprise policy. |
52 std::vector<std::unique_ptr<Printer>> GetRecommendedPrinters() const; | 52 std::vector<std::unique_ptr<Printer>> GetRecommendedPrinters() const; |
53 | 53 |
54 // Returns the printer with id |printer_id|. | 54 // Returns the printer with id |printer_id|, or nullptr if no such |
| 55 // printer exists. |
55 std::unique_ptr<Printer> GetPrinter(const std::string& printer_id) const; | 56 std::unique_ptr<Printer> GetPrinter(const std::string& printer_id) const; |
56 | 57 |
57 // Adds or updates a printer. Printers are identified by the id field. Use an | 58 // Adds or updates a printer. Printers are identified by the id field. Use an |
58 // empty id to add a new printer. | 59 // empty id to add a new printer. |
59 void RegisterPrinter(std::unique_ptr<Printer> printer); | 60 void RegisterPrinter(std::unique_ptr<Printer> printer); |
60 | 61 |
61 // Remove printer from preferences with the id |printer_id|. Returns true if | 62 // Remove printer from preferences with the id |printer_id|. Returns true if |
62 // the printer was successfully removed. | 63 // the printer was successfully removed. |
63 bool RemovePrinter(const std::string& printer_id); | 64 bool RemovePrinter(const std::string& printer_id); |
64 | 65 |
(...skipping 27 matching lines...) Expand all Loading... |
92 recommended_printers_; | 93 recommended_printers_; |
93 | 94 |
94 base::ObserverList<Observer> observers_; | 95 base::ObserverList<Observer> observers_; |
95 | 96 |
96 DISALLOW_COPY_AND_ASSIGN(PrintersManager); | 97 DISALLOW_COPY_AND_ASSIGN(PrintersManager); |
97 }; | 98 }; |
98 | 99 |
99 } // namespace chromeos | 100 } // namespace chromeos |
100 | 101 |
101 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_PRINTERS_MANAGER_H_ | 102 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_PRINTERS_MANAGER_H_ |
OLD | NEW |