forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfake_printer_discoverer.h
41 lines (29 loc) · 1.18 KB
/
fake_printer_discoverer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2016 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 CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_
#define CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_
#include <vector>
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "chromeos/printing/printer_configuration.h"
#include "chromeos/printing/printer_discoverer.h"
namespace chromeos {
class FakePrinterDiscoverer : public PrinterDiscoverer {
public:
FakePrinterDiscoverer();
~FakePrinterDiscoverer() override;
bool StartDiscovery() override;
bool StopDiscovery() override;
void AddObserver(PrinterDiscoverer::Observer* observer) override;
void RemoveObserver(PrinterDiscoverer::Observer* observer) override;
private:
void EmitPrinters(size_t start, size_t end);
std::vector<chromeos::Printer> printers_;
bool discovery_running_;
std::vector<PrinterDiscoverer::Observer*> observers_;
base::WeakPtrFactory<FakePrinterDiscoverer> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(FakePrinterDiscoverer);
};
} // namespace chromeos
#endif // CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_