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_TRAY_DISPLAY_H_ | 5 #ifndef ASH_SYSTEM_CHROMEOS_TRAY_DISPLAY_H_ |
6 #define ASH_SYSTEM_CHROMEOS_TRAY_DISPLAY_H_ | 6 #define ASH_SYSTEM_CHROMEOS_TRAY_DISPLAY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 virtual ~TrayDisplay(); | 30 virtual ~TrayDisplay(); |
31 | 31 |
32 // Overridden from DisplayControllerObserver: | 32 // Overridden from DisplayControllerObserver: |
33 virtual void OnDisplayConfigurationChanged() OVERRIDE; | 33 virtual void OnDisplayConfigurationChanged() OVERRIDE; |
34 | 34 |
35 private: | 35 private: |
36 friend class TrayDisplayTest; | 36 friend class TrayDisplayTest; |
37 | 37 |
38 typedef std::map<int64, DisplayInfo> DisplayInfoMap; | 38 typedef std::map<int64, DisplayInfo> DisplayInfoMap; |
39 | 39 |
40 // Checks the current display settings and determine what message should be | 40 // Scans the current display info and updates |display_info_|. Sets the |
41 // shown for notification. Returns true if there's a meaningful change. Note | 41 // previous data to |old_info| if it's not NULL. |
42 // that it's possible to return true and set |message| to empty, which means | 42 void UpdateDisplayInfo(DisplayInfoMap* old_info); |
43 // the notification should be removed. | 43 |
44 bool GetDisplayMessageForNotification(base::string16* message); | 44 // Compares the current display settings with |old_info| and determine what |
| 45 // message should be shown for notification. Returns true if there's a |
| 46 // meaningful change. Note that it's possible to return true and set |message| |
| 47 // to empty, which means the notification should be removed. |
| 48 bool GetDisplayMessageForNotification( |
| 49 base::string16* message, |
| 50 const DisplayInfoMap& old_info); |
45 | 51 |
46 // Overridden from SystemTrayItem. | 52 // Overridden from SystemTrayItem. |
47 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; | 53 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; |
48 virtual void DestroyDefaultView() OVERRIDE; | 54 virtual void DestroyDefaultView() OVERRIDE; |
49 | 55 |
50 // Test accessors. | 56 // Test accessors. |
51 base::string16 GetDefaultViewMessage(); | 57 base::string16 GetDefaultViewMessage(); |
52 base::string16 GetNotificationMessage(); | 58 base::string16 GetNotificationMessage(); |
53 void CloseNotificationForTest(); | 59 void CloseNotificationForTest(); |
54 views::View* default_view() { return default_; } | 60 views::View* default_view() { return default_; } |
55 | 61 |
56 views::View* default_; | 62 views::View* default_; |
57 DisplayInfoMap display_info_; | 63 DisplayInfoMap display_info_; |
58 | 64 |
59 DISALLOW_COPY_AND_ASSIGN(TrayDisplay); | 65 DISALLOW_COPY_AND_ASSIGN(TrayDisplay); |
60 }; | 66 }; |
61 | 67 |
62 } // namespace internal | 68 } // namespace internal |
63 } // namespace ash | 69 } // namespace ash |
64 | 70 |
65 #endif // ASH_SYSTEM_CHROMEOS_TRAY_DISPLAY_H_ | 71 #endif // ASH_SYSTEM_CHROMEOS_TRAY_DISPLAY_H_ |
OLD | NEW |