Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(740)

Unified Diff: ash/system/network/tray_sms.h

Issue 10582028: Re-factor TraySms to use ash::SmsObserver instead of NetoworkSmsHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/network/sms_observer.h ('k') | ash/system/network/tray_sms.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/network/tray_sms.h
diff --git a/ash/system/network/tray_sms.h b/ash/system/network/tray_sms.h
index 0650b6d5187d4cd84eacebc456df98acd810d844..0fd0b8301d1f876662abaa840b34d4c67ef26a42 100644
--- a/ash/system/network/tray_sms.h
+++ b/ash/system/network/tray_sms.h
@@ -8,13 +8,15 @@
#include <string>
+#include "ash/system/network/sms_observer.h"
#include "ash/system/tray/system_tray_item.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/values.h"
namespace ash {
namespace internal {
-class TraySms : public SystemTrayItem {
+class TraySms : public SystemTrayItem,
+ public SmsObserver {
public:
TraySms();
virtual ~TraySms();
@@ -28,27 +30,32 @@ class TraySms : public SystemTrayItem {
virtual void DestroyDetailedView() OVERRIDE;
virtual void DestroyNotificationView() OVERRIDE;
+ // Overridden from SmsObserver.
+ virtual void AddMessage(const base::DictionaryValue& message) OVERRIDE;
+
protected:
class SmsDefaultView;
class SmsDetailedView;
class SmsMessageView;
class SmsNotificationView;
- class SmsObserver;
// Gets the most recent message. Returns false if no messages or unable to
// retrieve the numebr and text from the message.
bool GetLatestMessage(size_t* index, std::string* number, std::string* text);
+ // Removes message at |index| from message list.
+ void RemoveMessage(size_t index);
+
// Called when sms messages have changed (by tray::SmsObserver).
void Update(bool notify);
- SmsObserver* sms_observer() const { return sms_observer_.get(); }
+ base::ListValue& messages() { return messages_; }
private:
SmsDefaultView* default_;
SmsDetailedView* detailed_;
SmsNotificationView* notification_;
- scoped_ptr<SmsObserver> sms_observer_;
+ base::ListValue messages_;
DISALLOW_COPY_AND_ASSIGN(TraySms);
};
« no previous file with comments | « ash/system/network/sms_observer.h ('k') | ash/system/network/tray_sms.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698