Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
|
tdanderson
2017/01/26 22:19:06
nit: update header - no (c) and update year.
yiyix
2017/02/02 20:43:56
Done.
| |
| 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 ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_SMS_OBSERVER_H_ | |
| 6 #define ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_SMS_OBSERVER_H_ | |
| 7 | |
| 8 #include <stddef.h> | |
| 9 | |
|
tdanderson
2017/01/26 22:19:06
nit: no blank line
yiyix
2017/02/02 20:43:56
Done.
| |
| 10 #include <string> | |
| 11 | |
| 12 #include "ash/common/system/tray/system_tray_item.h" | |
| 13 #include "base/macros.h" | |
| 14 #include "base/values.h" | |
| 15 #include "chromeos/network/network_sms_handler.h" | |
| 16 | |
| 17 namespace ash { | |
| 18 | |
| 19 class SmsObserver : public chromeos::NetworkSmsHandler::Observer { | |
|
tdanderson
2017/01/26 22:19:06
Please include some class-level documentation here
yiyix
2017/02/02 20:43:56
Done.
| |
| 20 public: | |
| 21 SmsObserver(); | |
| 22 ~SmsObserver() override; | |
| 23 | |
| 24 void Shutdown(); | |
| 25 | |
| 26 // chromeos::NetworkSmsHandler::Observer: | |
| 27 void MessageReceived(const base::DictionaryValue& message) override; | |
| 28 | |
| 29 protected: | |
| 30 // After receiving a text message with valid number and non-empty content, | |
| 31 // send the |message| to notification center to display to users. | |
| 32 void Update(const base::DictionaryValue* message, | |
|
tdanderson
2017/01/26 22:19:06
Why did you choose to make this protected rather t
yiyix
2017/02/02 20:43:56
Done.
| |
| 33 std::string message_text, | |
| 34 std::string message_number); | |
| 35 | |
| 36 private: | |
| 37 base::ListValue messages_; | |
|
tdanderson
2017/01/26 22:19:06
Please include a brief description for each member
yiyix
2017/02/02 20:43:56
I forget to delete this messages_ variable. It's n
tdanderson
2017/02/07 00:15:45
Acknowledged.
| |
| 38 | |
| 39 // Used to create notification identifier. | |
| 40 uint32_t message_id_; | |
| 41 static const char kNotificationId[]; | |
|
tdanderson
2017/01/26 22:19:06
I don't think you need to have this in the .h
yiyix
2017/02/02 20:43:56
I don't think i need it, but i see this pattern fo
tdanderson
2017/02/07 00:15:45
It's good to keep the header file as slim as possi
yiyix
2017/02/07 22:03:21
Agree. I will add it in this function as you sugge
| |
| 42 | |
| 43 DISALLOW_COPY_AND_ASSIGN(SmsObserver); | |
| 44 }; | |
| 45 | |
| 46 } // namespace ash | |
| 47 | |
| 48 #endif // ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_SMS_OBSERVER_H_ | |
| OLD | NEW |