OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROMEOS_DBUS_CROS_CONSOLE_SERVICE_CLIENT_H_ | |
6 #define CHROMEOS_DBUS_CROS_CONSOLE_SERVICE_CLIENT_H_ | |
stevenjb
2014/10/31 17:00:46
s/CROS_//
dsodman
2014/10/31 17:54:34
Done.
| |
7 | |
8 #include "base/observer_list.h" | |
9 #include "chromeos/chromeos_export.h" | |
10 #include "chromeos/dbus/dbus_client.h" | |
11 | |
12 namespace dbus { | |
13 class Bus; | |
14 class MethodCall; | |
15 class ExportedObject; | |
16 } | |
stevenjb
2014/10/31 17:00:46
None of these appear to be used in this header.
dsodman
2014/10/31 17:54:34
Done.
| |
17 | |
18 namespace chromeos { | |
19 | |
20 class CHROMEOS_EXPORT ConsoleServiceClient : public DBusClient { | |
21 public: | |
22 class Observer { | |
23 public: | |
24 virtual ~Observer() {} | |
stevenjb
2014/10/31 17:00:46
Destructor should be protected.
dsodman
2014/10/31 17:54:34
Done.
| |
25 virtual void OnActivateConsole(int console_id) {} | |
stevenjb
2014/10/31 17:00:47
This should be a pure virtual (= 0)
dsodman
2014/10/31 17:54:34
Done.
| |
26 }; | |
27 | |
28 virtual void AddObserver(Observer* observer) = 0; | |
29 virtual void RemoveObserver(Observer* observer) = 0; | |
30 virtual bool HasObserver(Observer* observer) = 0; | |
31 | |
32 static ConsoleServiceClient* Create(); | |
33 static ConsoleServiceClient* GetInstance(); | |
34 virtual ~ConsoleServiceClient() {} | |
stevenjb
2014/10/31 17:00:46
Use override:
~ConsoleServiceClient() override;
Al
dsodman
2014/10/31 17:54:34
Done.
| |
35 | |
36 protected: | |
37 ConsoleServiceClient(); | |
38 | |
39 private: | |
40 static ConsoleServiceClient* instance; | |
stevenjb
2014/10/31 17:00:46
Do not make this a class member, make it a file lo
dsodman
2014/10/31 17:54:34
Done.
| |
41 DISALLOW_COPY_AND_ASSIGN(ConsoleServiceClient); | |
42 }; | |
43 | |
44 } // namespace chromeos | |
45 | |
46 #endif // CHROMEOS_DBUS_CROS_CONSOLE_SERVICE_CLIENT_H_ | |
OLD | NEW |