sms_observer.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2017 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. #ifndef ASH_SYSTEM_NETWORK_SMS_OBSERVER_H_
  5. #define ASH_SYSTEM_NETWORK_SMS_OBSERVER_H_
  6. #include "ash/ash_export.h"
  7. #include "chromeos/ash/components/network/network_sms_handler.h"
  8. namespace ash {
  9. // SmsObserver is called when a new sms message is received. Then it shows the
  10. // sms message to the user in the notification center.
  11. class ASH_EXPORT SmsObserver : public NetworkSmsHandler::Observer {
  12. public:
  13. // The prefix of all SMS notifications.
  14. static const char kNotificationPrefix[];
  15. SmsObserver();
  16. SmsObserver(const SmsObserver&) = delete;
  17. SmsObserver& operator=(const SmsObserver&) = delete;
  18. ~SmsObserver() override;
  19. // NetworkSmsHandler::Observer:
  20. void MessageReceived(const base::Value& message) override;
  21. private:
  22. // Used to create notification identifier.
  23. uint32_t message_id_ = 0;
  24. };
  25. } // namespace ash
  26. #endif // ASH_SYSTEM_NETWORK_SMS_OBSERVER_H_