OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_MOBILE_MOBILE_ACTIVATOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_MOBILE_MOBILE_ACTIVATOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_MOBILE_MOBILE_ACTIVATOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_MOBILE_MOBILE_ACTIVATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "chrome/browser/chromeos/cros/network_library.h" | 16 #include "chrome/browser/chromeos/cros/network_library.h" |
17 | 17 |
18 namespace chromeos { | 18 namespace chromeos { |
19 | 19 |
20 // Cellular plan config document. | 20 // Cellular plan config document. |
21 class CellularConfigDocument | 21 class CellularConfigDocument |
22 : public base::RefCountedThreadSafe<CellularConfigDocument> { | 22 : public base::RefCountedThreadSafe<CellularConfigDocument> { |
23 public: | 23 public: |
24 CellularConfigDocument(); | 24 CellularConfigDocument(); |
25 virtual ~CellularConfigDocument(); | |
26 | 25 |
27 // Return error message for a given code. | 26 // Return error message for a given code. |
28 std::string GetErrorMessage(const std::string& code); | 27 std::string GetErrorMessage(const std::string& code); |
29 void LoadCellularConfigFile(); | 28 void LoadCellularConfigFile(); |
30 const std::string& version() { return version_; } | 29 const std::string& version() { return version_; } |
31 | 30 |
32 private: | 31 private: |
| 32 friend class base::RefCountedThreadSafe<CellularConfigDocument>; |
33 typedef std::map<std::string, std::string> ErrorMap; | 33 typedef std::map<std::string, std::string> ErrorMap; |
34 | 34 |
| 35 virtual ~CellularConfigDocument(); |
| 36 |
35 void SetErrorMap(const ErrorMap& map); | 37 void SetErrorMap(const ErrorMap& map); |
36 bool LoadFromFile(const FilePath& config_path); | 38 bool LoadFromFile(const FilePath& config_path); |
37 | 39 |
38 std::string version_; | 40 std::string version_; |
39 ErrorMap error_map_; | 41 ErrorMap error_map_; |
40 base::Lock config_lock_; | 42 base::Lock config_lock_; |
41 | 43 |
42 DISALLOW_COPY_AND_ASSIGN(CellularConfigDocument); | 44 DISALLOW_COPY_AND_ASSIGN(CellularConfigDocument); |
43 }; | 45 }; |
44 | 46 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 base::RepeatingTimer<MobileActivator> reconnect_timer_; | 237 base::RepeatingTimer<MobileActivator> reconnect_timer_; |
236 | 238 |
237 ObserverList<Observer> observers_; | 239 ObserverList<Observer> observers_; |
238 | 240 |
239 DISALLOW_COPY_AND_ASSIGN(MobileActivator); | 241 DISALLOW_COPY_AND_ASSIGN(MobileActivator); |
240 }; | 242 }; |
241 | 243 |
242 } // namespace chromeos | 244 } // namespace chromeos |
243 | 245 |
244 #endif // CHROME_BROWSER_CHROMEOS_MOBILE_MOBILE_ACTIVATOR_H_ | 246 #endif // CHROME_BROWSER_CHROMEOS_MOBILE_MOBILE_ACTIVATOR_H_ |
OLD | NEW |