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

Unified Diff: chrome/browser/chromeos/printing/combining_printer_detector.h

Issue 2945303005: Refactor PrinterDiscoverer and PrinterDetector to use a common interface. (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/printing/combining_printer_detector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/printing/combining_printer_detector.h
diff --git a/chrome/browser/chromeos/printing/combining_printer_detector.h b/chrome/browser/chromeos/printing/combining_printer_detector.h
new file mode 100644
index 0000000000000000000000000000000000000000..fcba36fc90c5d3efbe40336736782a1e00d2c399
--- /dev/null
+++ b/chrome/browser/chromeos/printing/combining_printer_detector.h
@@ -0,0 +1,34 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_PRINTING_COMBINING_PRINTER_DETECTOR_H_
+#define CHROME_BROWSER_CHROMEOS_PRINTING_COMBINING_PRINTER_DETECTOR_H_
+
+#include <memory>
+
+#include "chrome/browser/chromeos/printing/printer_detector.h"
+
+namespace chromeos {
+
+// CombiningPrinterDetector implements PrinterDetector and exports the combined
+// results of one or more underlying PrinterDetectors.
+class CHROMEOS_EXPORT CombiningPrinterDetector : public PrinterDetector {
+ public:
+ // Static factory
+ static std::unique_ptr<CombiningPrinterDetector> Create();
+
+ ~CombiningPrinterDetector() override = default;
+
+ // Add an underlying detector to be used. Ownership is not taken. All
+ // detectors should be added on the same sequence. Calling AddDetector after
+ // observers have been added is disallowed.
+ virtual void AddDetector(PrinterDetector* detector) = 0;
+
+ // Same as AddDetector, but ownership of the detector is taken.
+ virtual void AddOwnedDetector(std::unique_ptr<PrinterDetector> detector) = 0;
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_PRINTING_COMBINING_PRINTER_DETECTOR_H_
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/printing/combining_printer_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698