diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-18 23:00:25 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-18 23:00:25 +0000 |
commit | 3f6838701d4e64e564d0d8e3c1befca677b5f38a (patch) | |
tree | 6ce4b0b28d57cc2892477a3adc6a51920a3f5093 /ash/system/chromeos/tray_display.h | |
parent | 5a187e83735f8962fd2b4859e6fb5aea51bd331b (diff) | |
download | chromium_src-3f6838701d4e64e564d0d8e3c1befca677b5f38a.zip chromium_src-3f6838701d4e64e564d0d8e3c1befca677b5f38a.tar.gz chromium_src-3f6838701d4e64e564d0d8e3c1befca677b5f38a.tar.bz2 |
Distinguishes "nothing new" and "should be empty" in display notifications.
Sometimes OnDisplayConfigurationChanged() can be called twice or
even more, and in that case the notification will be cleared. This
is a side effect of closing stale notifications. We should distinguish
"nothing new happened actually" from "the notification should be
cleared", both has empty |message|.
BUG=260977
R=oshima@chromium.org
TEST=the new test case covers
Review URL: https://chromiumcodereview.appspot.com/19502002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212468 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/chromeos/tray_display.h')
-rw-r--r-- | ash/system/chromeos/tray_display.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ash/system/chromeos/tray_display.h b/ash/system/chromeos/tray_display.h index 7ede247..7adbd31 100644 --- a/ash/system/chromeos/tray_display.h +++ b/ash/system/chromeos/tray_display.h @@ -29,22 +29,24 @@ class ASH_EXPORT TrayDisplay : public SystemTrayItem, explicit TrayDisplay(SystemTray* system_tray); virtual ~TrayDisplay(); + // Overridden from DisplayControllerObserver: + virtual void OnDisplayConfigurationChanged() OVERRIDE; + private: 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(); + // shown for notification. Returns true if there's a meaningful change. Note + // that it's possible to return true and set |message| to empty, which means + // the notification should be removed. + bool GetDisplayMessageForNotification(base::string16* message); // Overridden from SystemTrayItem. virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; virtual void DestroyDefaultView() OVERRIDE; - // Overridden from DisplayControllerObserver: - virtual void OnDisplayConfigurationChanged() OVERRIDE; - // Test accessors. base::string16 GetDefaultViewMessage(); base::string16 GetNotificationMessage(); |