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

Side by Side Diff: chrome/browser/chromeos/printing/printer_pref_manager.h

Issue 2457933004: Register and select printer on click. (Closed)
Patch Set: rebase Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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_PRINTER_PREF_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_PREF_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_PREF_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_PREF_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 13 matching lines...) Expand all
24 class PrinterPrefManager : public KeyedService { 24 class PrinterPrefManager : public KeyedService {
25 public: 25 public:
26 explicit PrinterPrefManager(Profile* profile); 26 explicit PrinterPrefManager(Profile* profile);
27 27
28 // Register the printing preferences with the |registry|. 28 // Register the printing preferences with the |registry|.
29 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 29 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
30 30
31 // Returns the printers that are saved in preferences. 31 // Returns the printers that are saved in preferences.
32 std::vector<std::unique_ptr<Printer>> GetPrinters() const; 32 std::vector<std::unique_ptr<Printer>> GetPrinters() const;
33 33
34 // Returns the printer with id |printer_id|.
35 std::unique_ptr<Printer> GetPrinter(const std::string& printer_id) const;
36
34 // Adds or updates a printer. Printers are identified by the id field. Use an 37 // Adds or updates a printer. Printers are identified by the id field. Use an
35 // empty id to add a new printer. 38 // empty id to add a new printer.
36 void RegisterPrinter(std::unique_ptr<Printer> printer); 39 void RegisterPrinter(std::unique_ptr<Printer> printer);
37 40
38 // Remove printer from preferences with the id |printer_id|. Returns true if 41 // Remove printer from preferences with the id |printer_id|. Returns true if
39 // the printer was successfully removed. 42 // the printer was successfully removed.
40 bool RemovePrinter(const std::string& printer_id); 43 bool RemovePrinter(const std::string& printer_id);
41 44
42 private: 45 private:
43 Profile* profile_; 46 Profile* profile_;
44 }; 47 };
45 48
46 } // namespace chromeos 49 } // namespace chromeos
47 50
48 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_PREF_MANAGER_H_ 51 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_PREF_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698