Reenable NullOpenerRedirectForksProcess, as the offending patch has been reverted
[chromium-blink-merge.git] / chromeos / dbus / cashew_client.h
blobe208e883dbcbe2d962eb2780f9632d65df23d76e
1 // Copyright (c) 2012 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.
5 #ifndef CHROMEOS_DBUS_CASHEW_CLIENT_H_
6 #define CHROMEOS_DBUS_CASHEW_CLIENT_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/callback.h"
13 #include "chromeos/chromeos_export.h"
14 #include "chromeos/dbus/dbus_client_implementation_type.h"
16 namespace base {
17 class ListValue;
20 namespace dbus {
21 class Bus;
24 namespace chromeos {
26 // CashewClient is used to communicate with the Cashew service.
27 // All methods should be called from the origin thread (UI thread) which
28 // initializes the DBusThreadManager instance.
29 class CHROMEOS_EXPORT CashewClient {
30 public:
31 // A callback to handle "DataPlansUpdate" signal.
32 // |service| is the D-Bus path of the cellular service.
33 // (e.g. /service/cellular_0271266ce2ce_310260467781434)
34 typedef base::Callback<void(const std::string& service,
35 const base::ListValue& data_plans)>
36 DataPlansUpdateHandler;
38 virtual ~CashewClient();
40 // Factory function, creates a new instance and returns ownership.
41 // For normal usage, access the singleton via DBusThreadManager::Get().
42 static CashewClient* Create(DBusClientImplementationType type,
43 dbus::Bus* bus);
45 // Sets DataPlansUpdate signal handler.
46 virtual void SetDataPlansUpdateHandler(
47 const DataPlansUpdateHandler& handler) = 0;
49 // Resets DataPlansUpdate signal handler.
50 virtual void ResetDataPlansUpdateHandler() = 0;
52 // Calls RequestDataPlansUpdate method.
53 virtual void RequestDataPlansUpdate(const std::string& service) = 0;
55 protected:
56 // Create() should be used instead.
57 CashewClient();
59 private:
60 DISALLOW_COPY_AND_ASSIGN(CashewClient);
63 } // namespace chromeos
65 #endif // CHROMEOS_DBUS_CASHEW_CLIENT_H_