| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_CASHEW_CLIENT_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_DBUS_CASHEW_CLIENT_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/basictypes.h" | |
| 13 #include "base/callback.h" | |
| 14 | |
| 15 namespace base { | |
| 16 class ListValue; | |
| 17 } | |
| 18 | |
| 19 namespace dbus { | |
| 20 class Bus; | |
| 21 } | |
| 22 | |
| 23 namespace chromeos { | |
| 24 | |
| 25 // CashewClient is used to communicate with the Cashew service. | |
| 26 // All methods should be called from the origin thread (UI thread) which | |
| 27 // initializes the DBusThreadManager instance. | |
| 28 class CashewClient { | |
| 29 public: | |
| 30 // A callback to handle "DataPlansUpdate" signal. | |
| 31 typedef base::Callback<void(const base::ListValue& data_plans)> | |
| 32 DataPlansUpdateHandler; | |
| 33 | |
| 34 virtual ~CashewClient(); | |
| 35 | |
| 36 // Factory function, creates a new instance and returns ownership. | |
| 37 // For normal usage, access the singleton via DBusThreadManager::Get(). | |
| 38 static CashewClient* Create(dbus::Bus* bus); | |
| 39 | |
| 40 // Sets DataPlansUpdate signal handler. | |
| 41 virtual void SetDataPlansUpdateHandler(DataPlansUpdateHandler handler) = 0; | |
| 42 | |
| 43 // Resets DataPlansUpdate signal handler. | |
| 44 virtual void ResetDataPlansUpdateHandler() = 0; | |
| 45 | |
| 46 // Calls RequestDataPlansUpdate method. | |
| 47 virtual void RequestDataPlansUpdate() = 0; | |
| 48 | |
| 49 protected: | |
| 50 // Create() should be used instead. | |
| 51 CashewClient(); | |
| 52 | |
| 53 private: | |
| 54 DISALLOW_COPY_AND_ASSIGN(CashewClient); | |
| 55 }; | |
| 56 | |
| 57 } // namespace chromeos | |
| 58 | |
| 59 #endif // CHROME_BROWSER_CHROMEOS_DBUS_CASHEW_CLIENT_H_ | |
| OLD | NEW |