Chromium Code Reviews| 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, const DisplayInfoMap& old_info); | |
|
stevenjb
2013/08/12 21:52:07
one arg per line if not on the same line as the fu
Jun Mukai
2013/08/12 22:07:49
Done.
| |
| 45 | 50 |
| 46 // Overridden from SystemTrayItem. | 51 // Overridden from SystemTrayItem. |
| 47 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; | 52 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; |
| 48 virtual void DestroyDefaultView() OVERRIDE; | 53 virtual void DestroyDefaultView() OVERRIDE; |
| 49 | 54 |
| 50 // Test accessors. | 55 // Test accessors. |
| 51 base::string16 GetDefaultViewMessage(); | 56 base::string16 GetDefaultViewMessage(); |
| 52 base::string16 GetNotificationMessage(); | 57 base::string16 GetNotificationMessage(); |
| 53 void CloseNotificationForTest(); | 58 void CloseNotificationForTest(); |
| 54 views::View* default_view() { return default_; } | 59 views::View* default_view() { return default_; } |
| 55 | 60 |
| 56 views::View* default_; | 61 views::View* default_; |
| 57 DisplayInfoMap display_info_; | 62 DisplayInfoMap display_info_; |
| 58 | 63 |
| 59 DISALLOW_COPY_AND_ASSIGN(TrayDisplay); | 64 DISALLOW_COPY_AND_ASSIGN(TrayDisplay); |
| 60 }; | 65 }; |
| 61 | 66 |
| 62 } // namespace internal | 67 } // namespace internal |
| 63 } // namespace ash | 68 } // namespace ash |
| 64 | 69 |
| 65 #endif // ASH_SYSTEM_CHROMEOS_TRAY_DISPLAY_H_ | 70 #endif // ASH_SYSTEM_CHROMEOS_TRAY_DISPLAY_H_ |
| OLD | NEW |