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 <stdint.h> |
| 9 |
8 #include <map> | 10 #include <map> |
9 | 11 |
10 #include "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
11 #include "ash/display/display_info.h" | 13 #include "ash/display/display_info.h" |
12 #include "ash/display/window_tree_host_manager.h" | 14 #include "ash/display/window_tree_host_manager.h" |
13 #include "ash/system/tray/system_tray_item.h" | 15 #include "ash/system/tray/system_tray_item.h" |
| 16 #include "base/macros.h" |
14 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
15 #include "ui/views/view.h" | 18 #include "ui/views/view.h" |
16 | 19 |
17 namespace ash { | 20 namespace ash { |
18 class DisplayView; | 21 class DisplayView; |
19 | 22 |
20 namespace test { | 23 namespace test { |
21 class AshTestBase; | 24 class AshTestBase; |
22 } | 25 } |
23 | 26 |
24 class ASH_EXPORT TrayDisplay : public SystemTrayItem, | 27 class ASH_EXPORT TrayDisplay : public SystemTrayItem, |
25 public WindowTreeHostManager::Observer { | 28 public WindowTreeHostManager::Observer { |
26 public: | 29 public: |
27 explicit TrayDisplay(SystemTray* system_tray); | 30 explicit TrayDisplay(SystemTray* system_tray); |
28 ~TrayDisplay() override; | 31 ~TrayDisplay() override; |
29 | 32 |
30 // Overridden from WindowTreeHostManagerObserver: | 33 // Overridden from WindowTreeHostManagerObserver: |
31 void OnDisplayConfigurationChanged() override; | 34 void OnDisplayConfigurationChanged() override; |
32 | 35 |
33 private: | 36 private: |
34 friend class TrayDisplayTest; | 37 friend class TrayDisplayTest; |
35 | 38 |
36 typedef std::map<int64, DisplayInfo> DisplayInfoMap; | 39 typedef std::map<int64_t, DisplayInfo> DisplayInfoMap; |
37 | 40 |
38 static const char kNotificationId[]; | 41 static const char kNotificationId[]; |
39 | 42 |
40 // Scans the current display info and updates |display_info_|. Sets the | 43 // Scans the current display info and updates |display_info_|. Sets the |
41 // previous data to |old_info| if it's not NULL. | 44 // previous data to |old_info| if it's not NULL. |
42 void UpdateDisplayInfo(DisplayInfoMap* old_info); | 45 void UpdateDisplayInfo(DisplayInfoMap* old_info); |
43 | 46 |
44 // Compares the current display settings with |old_info| and determine what | 47 // Compares the current display settings with |old_info| and determine what |
45 // message should be shown for notification. Returns true if there's a | 48 // 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 | 49 // meaningful change. Note that it's possible to return true and set |
(...skipping 22 matching lines...) Expand all Loading... |
69 | 72 |
70 DisplayView* default_; | 73 DisplayView* default_; |
71 DisplayInfoMap display_info_; | 74 DisplayInfoMap display_info_; |
72 | 75 |
73 DISALLOW_COPY_AND_ASSIGN(TrayDisplay); | 76 DISALLOW_COPY_AND_ASSIGN(TrayDisplay); |
74 }; | 77 }; |
75 | 78 |
76 } // namespace ash | 79 } // namespace ash |
77 | 80 |
78 #endif // ASH_SYSTEM_CHROMEOS_TRAY_DISPLAY_H_ | 81 #endif // ASH_SYSTEM_CHROMEOS_TRAY_DISPLAY_H_ |
OLD | NEW |