ProfilePolicyConnectorFactory: Refactoring from Profile to BrowserContext.
[chromium-blink-merge.git] / ash / system / chromeos / network / tray_sms.h
blobcc6f2b71ad1f8a0d79ceb84a696616462f76728c
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
3 // found in the LICENSE file.
5 #ifndef ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_SMS_H
6 #define ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_SMS_H
8 #include <string>
10 #include "ash/system/tray/system_tray_item.h"
11 #include "base/values.h"
12 #include "chromeos/network/network_sms_handler.h"
14 namespace ash {
16 class TraySms : public SystemTrayItem,
17 public chromeos::NetworkSmsHandler::Observer {
18 public:
19 explicit TraySms(SystemTray* system_tray);
20 ~TraySms() override;
22 // Overridden from SystemTrayItem.
23 views::View* CreateDefaultView(user::LoginStatus status) override;
24 views::View* CreateDetailedView(user::LoginStatus status) override;
25 views::View* CreateNotificationView(user::LoginStatus status) override;
26 void DestroyDefaultView() override;
27 void DestroyDetailedView() override;
28 void DestroyNotificationView() override;
30 // Overridden from chromeos::NetworkSmsHandler::Observer.
31 void MessageReceived(const base::DictionaryValue& message) override;
33 protected:
34 class SmsDefaultView;
35 class SmsDetailedView;
36 class SmsMessageView;
37 class SmsNotificationView;
39 // Gets the most recent message. Returns false if no messages or unable to
40 // retrieve the numebr and text from the message.
41 bool GetLatestMessage(size_t* index, std::string* number, std::string* text);
43 // Removes message at |index| from message list.
44 void RemoveMessage(size_t index);
46 // Called when sms messages have changed (through
47 // chromeos::NetworkSmsHandler::Observer).
48 void Update(bool notify);
50 base::ListValue& messages() { return messages_; }
52 private:
53 SmsDefaultView* default_;
54 SmsDetailedView* detailed_;
55 SmsNotificationView* notification_;
56 base::ListValue messages_;
58 DISALLOW_COPY_AND_ASSIGN(TraySms);
61 } // namespace ash
63 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_SMS_H