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

Side by Side Diff: ash/system/chromeos/screen_layout_observer.h

Issue 2644593003: Fix bugs in the display notification (Closed)
Patch Set: Oshima's comments Created 3 years, 11 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
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_CHROMEOS_SCREEN_LAYOUT_OBSERVER_H_ 5 #ifndef ASH_SYSTEM_CHROMEOS_SCREEN_LAYOUT_OBSERVER_H_
6 #define ASH_SYSTEM_CHROMEOS_SCREEN_LAYOUT_OBSERVER_H_ 6 #define ASH_SYSTEM_CHROMEOS_SCREEN_LAYOUT_OBSERVER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // previous data to |old_info| if it's not NULL. 44 // previous data to |old_info| if it's not NULL.
45 void UpdateDisplayInfo(DisplayInfoMap* old_info); 45 void UpdateDisplayInfo(DisplayInfoMap* old_info);
46 46
47 // Compares the current display settings with |old_info| and determine what 47 // Compares the current display settings with |old_info| and determine what
48 // 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
49 // 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
50 // |message_out| to empty, which means the notification should be removed. It 50 // |message_out| to empty, which means the notification should be removed. It
51 // also sets |additional_message_out| which appears in the notification with 51 // also sets |additional_message_out| which appears in the notification with
52 // the |message_out|. 52 // the |message_out|.
53 bool GetDisplayMessageForNotification(const DisplayInfoMap& old_info, 53 bool GetDisplayMessageForNotification(const DisplayInfoMap& old_info,
54 base::string16* message_out, 54 base::string16* out_message,
55 base::string16* additional_message_out); 55 base::string16* out_additional_message);
56 56
57 // Creates or updates the display notification. 57 // Creates or updates the display notification.
58 void CreateOrUpdateNotification(const base::string16& message, 58 void CreateOrUpdateNotification(const base::string16& message,
59 const base::string16& additional_message); 59 const base::string16& additional_message);
60 60
61 DisplayInfoMap display_info_; 61 DisplayInfoMap display_info_;
62 62
63 enum class DisplayMode {
64 SINGLE,
65 EXTENDED,
66 MIRRORING,
67 UNIFIED,
68 };
69
70 DisplayMode old_display_mode_ = DisplayMode::SINGLE;
71 DisplayMode current_display_mode_ = DisplayMode::SINGLE;
72
63 bool show_notifications_for_testing = true; 73 bool show_notifications_for_testing = true;
64 74
65 DISALLOW_COPY_AND_ASSIGN(ScreenLayoutObserver); 75 DISALLOW_COPY_AND_ASSIGN(ScreenLayoutObserver);
66 }; 76 };
67 77
68 } // namespace ash 78 } // namespace ash
69 79
70 #endif // ASH_SYSTEM_CHROMEOS_SCREEN_LAYOUT_OBSERVER_H_ 80 #endif // ASH_SYSTEM_CHROMEOS_SCREEN_LAYOUT_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698