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

Side by Side Diff: ash/system/network/tray_sms.h

Issue 10443004: Move common notification layout to base class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_NETWORK_TRAY_SMS_H 5 #ifndef ASH_SYSTEM_NETWORK_TRAY_SMS_H
6 #define ASH_SYSTEM_NETWORK_TRAY_SMS_H 6 #define ASH_SYSTEM_NETWORK_TRAY_SMS_H
7 #pragma once 7 #pragma once
8 8
9 #include "ash/system/tray/tray_image_item.h" 9 #include <string>
10
11 #include "ash/system/tray/system_tray_item.h"
10 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
11 13
12 namespace ash { 14 namespace ash {
13 namespace internal { 15 namespace internal {
14 16
15 class TraySms : public TrayImageItem { 17 class TraySms : public SystemTrayItem {
16 public: 18 public:
17 TraySms(); 19 TraySms();
18 virtual ~TraySms(); 20 virtual ~TraySms();
19 21
20 // Overridden from SystemTrayItem. 22 // Overridden from SystemTrayItem.
21 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; 23 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
22 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; 24 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
23 virtual views::View* CreateNotificationView( 25 virtual views::View* CreateNotificationView(
24 user::LoginStatus status) OVERRIDE; 26 user::LoginStatus status) OVERRIDE;
25 virtual void DestroyDefaultView() OVERRIDE; 27 virtual void DestroyDefaultView() OVERRIDE;
26 virtual void DestroyDetailedView() OVERRIDE; 28 virtual void DestroyDetailedView() OVERRIDE;
27 virtual void DestroyNotificationView() OVERRIDE; 29 virtual void DestroyNotificationView() OVERRIDE;
28 30
29 // Overridden from TrayImageItem. 31 // Overridden from TrayImageItem.
30 virtual bool GetInitialVisibility() OVERRIDE; 32 virtual bool GetInitialVisibility() OVERRIDE;
sadrul 2012/05/24 04:12:50 This isn't necessary anymore.
stevenjb 2012/05/24 16:48:01 Done.
31 33
32 protected: 34 protected:
33 class SmsDefaultView; 35 class SmsDefaultView;
34 class SmsDetailedView; 36 class SmsDetailedView;
35 class SmsMessageView; 37 class SmsMessageView;
36 class SmsNotificationView; 38 class SmsNotificationView;
37 class SmsObserver; 39 class SmsObserver;
38 40
41 // Gets the most recent message. Returns false if no messages or unable to
42 // retrieve the numebr and text from the message.
43 bool GetLatestMessage(size_t* index, std::string* number, std::string* text);
44
39 // Called when sms messages have changed (by tray::SmsObserver). 45 // Called when sms messages have changed (by tray::SmsObserver).
40 void Update(bool notify); 46 void Update(bool notify);
41 47
42 SmsObserver* sms_observer() const { return sms_observer_.get(); } 48 SmsObserver* sms_observer() const { return sms_observer_.get(); }
43 49
44 private: 50 private:
45 SmsDefaultView* default_; 51 SmsDefaultView* default_;
46 SmsDetailedView* detailed_; 52 SmsDetailedView* detailed_;
47 SmsNotificationView* notification_; 53 SmsNotificationView* notification_;
48 scoped_ptr<SmsObserver> sms_observer_; 54 scoped_ptr<SmsObserver> sms_observer_;
49 55
50 DISALLOW_COPY_AND_ASSIGN(TraySms); 56 DISALLOW_COPY_AND_ASSIGN(TraySms);
51 }; 57 };
52 58
53 } // namespace internal 59 } // namespace internal
54 } // namespace ash 60 } // namespace ash
55 61
56 #endif // ASH_SYSTEM_NETWORK_TRAY_SMS_H 62 #endif // ASH_SYSTEM_NETWORK_TRAY_SMS_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698