| 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_SMS_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SMS_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_SMS_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SMS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "chrome/browser/chromeos/cros/network_library.h" | 13 #include "chrome/browser/chromeos/cros/network_library.h" |
| 14 | 14 |
| 15 class Profile; | 15 class Profile; |
| 16 | 16 |
| 17 namespace chromeos { | 17 namespace chromeos { |
| 18 | 18 |
| 19 class CrosNetworkWatcher; | 19 class CrosNetworkWatcher; |
| 20 struct SMS; | 20 struct SMS; |
| 21 | 21 |
| 22 // Performs monitoring of incoming SMS and shows system notifications. | 22 // Performs monitoring of incoming SMS and shows system notifications. |
| 23 class SmsObserver : public NetworkLibrary::NetworkManagerObserver { | 23 class SmsObserver : public NetworkLibrary::NetworkManagerObserver { |
| 24 public: | 24 public: |
| 25 explicit SmsObserver(Profile* profile); | 25 SmsObserver(); |
| 26 virtual ~SmsObserver(); | 26 virtual ~SmsObserver(); |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 typedef std::map<std::string, CrosNetworkWatcher*> ObserversMap; | 29 typedef std::map<std::string, CrosNetworkWatcher*> ObserversMap; |
| 30 | 30 |
| 31 // NetworkLibrary:NetworkManagerObserver implementation: | 31 // NetworkLibrary:NetworkManagerObserver implementation: |
| 32 virtual void OnNetworkManagerChanged(NetworkLibrary* obj) OVERRIDE; | 32 virtual void OnNetworkManagerChanged(NetworkLibrary* obj) OVERRIDE; |
| 33 | 33 |
| 34 void OnNewMessage(const std::string& modem_device_path, const SMS& message); | 34 void OnNewMessage(const std::string& modem_device_path, const SMS& message); |
| 35 | 35 |
| 36 void UpdateObservers(NetworkLibrary* library); | 36 void UpdateObservers(NetworkLibrary* library); |
| 37 void DisconnectAll(); | 37 void DisconnectAll(); |
| 38 | 38 |
| 39 Profile* profile_; | |
| 40 ObserversMap observers_; | 39 ObserversMap observers_; |
| 41 | 40 |
| 42 DISALLOW_COPY_AND_ASSIGN(SmsObserver); | 41 DISALLOW_COPY_AND_ASSIGN(SmsObserver); |
| 43 }; | 42 }; |
| 44 | 43 |
| 45 } // namespace chromeos | 44 } // namespace chromeos |
| 46 | 45 |
| 47 #endif // CHROME_BROWSER_CHROMEOS_SMS_OBSERVER_H_ | 46 #endif // CHROME_BROWSER_CHROMEOS_SMS_OBSERVER_H_ |
| OLD | NEW |