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

Unified Diff: ash/system/chromeos/tray_display.h

Issue 17445002: Updates the display message in the uber tray. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash_strings.grd ('k') | ash/system/chromeos/tray_display.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/tray_display.h
diff --git a/ash/system/chromeos/tray_display.h b/ash/system/chromeos/tray_display.h
index 0265704ea677b3eb92943838ed52459a8c594575..4c2faa73bd0c74866a3f5cdcf2e5abe1b0a09cb4 100644
--- a/ash/system/chromeos/tray_display.h
+++ b/ash/system/chromeos/tray_display.h
@@ -5,33 +5,40 @@
#ifndef ASH_SYSTEM_CHROMEOS_TRAY_DISPLAY_H_
#define ASH_SYSTEM_CHROMEOS_TRAY_DISPLAY_H_
+#include <map>
+
+#include "ash/ash_export.h"
#include "ash/display/display_controller.h"
+#include "ash/display/display_info.h"
#include "ash/system/tray/system_tray_item.h"
+#include "base/strings/string16.h"
+#include "ui/views/view.h"
-namespace views {
-class View;
+namespace ash {
+namespace test {
+class AshTestBase;
}
-namespace ash {
namespace internal {
-enum TrayDisplayMode {
- TRAY_DISPLAY_SINGLE,
- TRAY_DISPLAY_EXTENDED,
- TRAY_DISPLAY_MIRRORED,
- TRAY_DISPLAY_DOCKED,
-};
-
-class DisplayView;
class DisplayNotificationView;
-class TrayDisplay : public SystemTrayItem,
- public DisplayController::Observer {
+class ASH_EXPORT TrayDisplay : public SystemTrayItem,
+ public DisplayController::Observer {
public:
explicit TrayDisplay(SystemTray* system_tray);
virtual ~TrayDisplay();
private:
+ friend class test::AshTestBase;
+ friend class TrayDisplayTest;
+
+ typedef std::map<int64, DisplayInfo> DisplayInfoMap;
+
+ // Checks the current display settings and determine what message should be
+ // shown for notification.
+ base::string16 GetDisplayMessageForNotification();
+
// Overridden from SystemTrayItem.
virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
virtual views::View* CreateNotificationView(
@@ -43,9 +50,19 @@ class TrayDisplay : public SystemTrayItem,
// Overridden from DisplayControllerObserver:
virtual void OnDisplayConfigurationChanged() OVERRIDE;
- DisplayView* default_;
+ // Call this with |diabled| = false when the test case wants to see the
+ // display notification.
+ static void SetDisplayNotificationsDisabledForTest(bool disabled);
+
+ // Test accessors.
+ base::string16 GetDefaultViewMessage();
+ views::View* default_view() { return default_; }
+ const string16& current_message() const { return current_message_; }
+
+ views::View* default_;
DisplayNotificationView* notification_;
- TrayDisplayMode current_mode_;
+ string16 current_message_;
+ DisplayInfoMap display_info_;
DISALLOW_COPY_AND_ASSIGN(TrayDisplay);
};
« no previous file with comments | « ash/ash_strings.grd ('k') | ash/system/chromeos/tray_display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698