Darin Petkov | 41c0e0a | 2012-01-09 16:38:53 +0100 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 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 Petkov | 137884a | 2011-10-26 18:52:47 +0200 | [diff] [blame] | 13 | struct mobile_provider_db; |
| 14 | |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 15 | namespace shill { |
| 16 | |
| 17 | class ControlInterface; |
| 18 | class EventDispatcher; |
| 19 | class GLib; |
| 20 | class Manager; |
| 21 | class ModemManager; |
| 22 | |
| 23 | // Manages modem managers. |
| 24 | class 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 | |
Darin Petkov | 41c0e0a | 2012-01-09 16:38:53 +0100 | [diff] [blame] | 35 | void OnDeviceInfoAvailable(const std::string &link_name); |
| 36 | |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 37 | private: |
| 38 | friend class ModemInfoTest; |
| 39 | FRIEND_TEST(ModemInfoTest, RegisterModemManager); |
| 40 | FRIEND_TEST(ModemInfoTest, StartStop); |
| 41 | |
Darin Petkov | 41c0e0a | 2012-01-09 16:38:53 +0100 | [diff] [blame] | 42 | typedef ScopedVector<ModemManager> ModemManagers; |
| 43 | |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 44 | static const char kCromoService[]; |
| 45 | static const char kCromoPath[]; |
Darin Petkov | 137884a | 2011-10-26 18:52:47 +0200 | [diff] [blame] | 46 | static const char kMobileProviderDBPath[]; |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 47 | |
| 48 | // Registers a new ModemManager service handler and starts it. |
| 49 | void RegisterModemManager(const std::string &service, |
| 50 | const std::string &path); |
| 51 | |
Darin Petkov | 41c0e0a | 2012-01-09 16:38:53 +0100 | [diff] [blame] | 52 | ModemManagers modem_managers_; |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 53 | |
| 54 | ControlInterface *control_interface_; |
| 55 | EventDispatcher *dispatcher_; |
| 56 | Manager *manager_; |
| 57 | GLib *glib_; |
| 58 | |
Darin Petkov | 137884a | 2011-10-26 18:52:47 +0200 | [diff] [blame] | 59 | std::string provider_db_path_; // For testing. |
| 60 | mobile_provider_db *provider_db_; // Database instance owned by |this|. |
| 61 | |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 62 | DISALLOW_COPY_AND_ASSIGN(ModemInfo); |
| 63 | }; |
| 64 | |
| 65 | } // namespace shill |
| 66 | |
| 67 | #endif // SHILL_MODEM_INFO_ |