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 ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_SMS_H | 5 #ifndef ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_SMS_H |
6 #define ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_SMS_H | 6 #define ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_SMS_H |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/system/tray/system_tray_item.h" | 10 #include "ash/system/tray/system_tray_item.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chromeos/network/network_sms_handler.h" | 12 #include "chromeos/network/network_sms_handler.h" |
13 | 13 |
14 namespace ash { | 14 namespace ash { |
15 | 15 |
16 class TraySms : public SystemTrayItem, | 16 class TraySms : public SystemTrayItem, |
17 public chromeos::NetworkSmsHandler::Observer { | 17 public chromeos::NetworkSmsHandler::Observer { |
18 public: | 18 public: |
19 explicit TraySms(SystemTray* system_tray); | 19 explicit TraySms(SystemTray* system_tray); |
20 virtual ~TraySms(); | 20 ~TraySms() override; |
21 | 21 |
22 // Overridden from SystemTrayItem. | 22 // Overridden from SystemTrayItem. |
23 virtual views::View* CreateDefaultView(user::LoginStatus status) override; | 23 views::View* CreateDefaultView(user::LoginStatus status) override; |
24 virtual views::View* CreateDetailedView(user::LoginStatus status) override; | 24 views::View* CreateDetailedView(user::LoginStatus status) override; |
25 virtual views::View* CreateNotificationView( | 25 views::View* CreateNotificationView(user::LoginStatus status) override; |
26 user::LoginStatus status) override; | 26 void DestroyDefaultView() override; |
27 virtual void DestroyDefaultView() override; | 27 void DestroyDetailedView() override; |
28 virtual void DestroyDetailedView() override; | 28 void DestroyNotificationView() override; |
29 virtual void DestroyNotificationView() override; | |
30 | 29 |
31 // Overridden from chromeos::NetworkSmsHandler::Observer. | 30 // Overridden from chromeos::NetworkSmsHandler::Observer. |
32 virtual void MessageReceived(const base::DictionaryValue& message) override; | 31 void MessageReceived(const base::DictionaryValue& message) override; |
33 | 32 |
34 protected: | 33 protected: |
35 class SmsDefaultView; | 34 class SmsDefaultView; |
36 class SmsDetailedView; | 35 class SmsDetailedView; |
37 class SmsMessageView; | 36 class SmsMessageView; |
38 class SmsNotificationView; | 37 class SmsNotificationView; |
39 | 38 |
40 // Gets the most recent message. Returns false if no messages or unable to | 39 // Gets the most recent message. Returns false if no messages or unable to |
41 // retrieve the numebr and text from the message. | 40 // retrieve the numebr and text from the message. |
42 bool GetLatestMessage(size_t* index, std::string* number, std::string* text); | 41 bool GetLatestMessage(size_t* index, std::string* number, std::string* text); |
(...skipping 12 matching lines...) Expand all Loading... |
55 SmsDetailedView* detailed_; | 54 SmsDetailedView* detailed_; |
56 SmsNotificationView* notification_; | 55 SmsNotificationView* notification_; |
57 base::ListValue messages_; | 56 base::ListValue messages_; |
58 | 57 |
59 DISALLOW_COPY_AND_ASSIGN(TraySms); | 58 DISALLOW_COPY_AND_ASSIGN(TraySms); |
60 }; | 59 }; |
61 | 60 |
62 } // namespace ash | 61 } // namespace ash |
63 | 62 |
64 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_SMS_H | 63 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_SMS_H |
OLD | NEW |