blob: 2678e376d0d6bd3a56dfd1a6c36fdea641508d4b [file] [log] [blame]
Darin Petkov887f2982011-07-14 16:10:17 -07001// Copyright (c) 2011 The Chromium OS 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 SHILL_MODEM_INFO_
6#define SHILL_MODEM_INFO_
7
8#include <string>
9
10#include <base/memory/scoped_vector.h>
11#include <gtest/gtest_prod.h> // for FRIEND_TEST
12
Darin Petkov137884a2011-10-26 18:52:47 +020013struct mobile_provider_db;
14
Darin Petkov887f2982011-07-14 16:10:17 -070015namespace shill {
16
17class ControlInterface;
18class EventDispatcher;
19class GLib;
20class Manager;
21class ModemManager;
22
23// Manages modem managers.
24class ModemInfo {
25 public:
26 ModemInfo(ControlInterface *control_interface,
27 EventDispatcher *dispatcher,
28 Manager *manager,
29 GLib *glib);
30 ~ModemInfo();
31
32 void Start();
33 void Stop();
34
35 private:
36 friend class ModemInfoTest;
37 FRIEND_TEST(ModemInfoTest, RegisterModemManager);
38 FRIEND_TEST(ModemInfoTest, StartStop);
39
40 static const char kCromoService[];
41 static const char kCromoPath[];
Darin Petkov137884a2011-10-26 18:52:47 +020042 static const char kMobileProviderDBPath[];
Darin Petkov887f2982011-07-14 16:10:17 -070043
44 // Registers a new ModemManager service handler and starts it.
45 void RegisterModemManager(const std::string &service,
46 const std::string &path);
47
48 ScopedVector<ModemManager> modem_managers_;
49
50 ControlInterface *control_interface_;
51 EventDispatcher *dispatcher_;
52 Manager *manager_;
53 GLib *glib_;
54
Darin Petkov137884a2011-10-26 18:52:47 +020055 std::string provider_db_path_; // For testing.
56 mobile_provider_db *provider_db_; // Database instance owned by |this|.
57
Darin Petkov887f2982011-07-14 16:10:17 -070058 DISALLOW_COPY_AND_ASSIGN(ModemInfo);
59};
60
61} // namespace shill
62
63#endif // SHILL_MODEM_INFO_