diff options
author | dgozman@chromium.org <dgozman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-29 12:09:10 +0000 |
---|---|---|
committer | dgozman@chromium.org <dgozman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-29 12:09:10 +0000 |
commit | 54113a892855a95f3b00e7543f07e89fbd59923b (patch) | |
tree | 34a8a803d801b52cd05162662489aa7e39b837e5 | |
parent | b0cfd90ed62755dca0ac8441a4dfa0a46d2a1172 (diff) | |
download | chromium_src-54113a892855a95f3b00e7543f07e89fbd59923b.zip chromium_src-54113a892855a95f3b00e7543f07e89fbd59923b.tar.gz chromium_src-54113a892855a95f3b00e7543f07e89fbd59923b.tar.bz2 |
[chromeos] Do not move notifications to KEEP_SIZE state when mouse moved.
This allows notification to resize.
BUG=chromium-os:16050
TEST=See bug.
Review URL: http://codereview.chromium.org/7747044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98618 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/notifications/notification_browsertest.cc | 13 | ||||
-rw-r--r-- | chrome/browser/chromeos/notifications/notification_panel.cc | 6 |
2 files changed, 12 insertions, 7 deletions
diff --git a/chrome/browser/chromeos/notifications/notification_browsertest.cc b/chrome/browser/chromeos/notifications/notification_browsertest.cc index 2df6bd4..d7f18c4 100644 --- a/chrome/browser/chromeos/notifications/notification_browsertest.cc +++ b/chrome/browser/chromeos/notifications/notification_browsertest.cc @@ -174,8 +174,9 @@ IN_PROC_BROWSER_TEST_F(NotificationTest, TestBasic) { ui_test_utils::RunAllPendingInMessageLoop(); } -// [CLOSED] -add->[STICKY_AND_NEW] -mouse-> [KEEP_SIZE] -remove/add-> -// [KEEP_SIZE] -remove-> [CLOSED] -add-> [STICKY_AND_NEW] -remove-> [CLOSED] +// [CLOSED] -add->[STICKY_AND_NEW] -mouse-> [STICKY_AND_NEW] -remove/add-> +// [STICKY_AND_NEW] -remove-> [CLOSED] -add-> [STICKY_AND_NEW] -remove-> +// [CLOSED] IN_PROC_BROWSER_TEST_F(NotificationTest, TestKeepSizeState) { BalloonCollectionImpl* collection = GetBalloonCollectionImpl(); NotificationPanel* panel = GetNotificationPanel(); @@ -190,25 +191,25 @@ IN_PROC_BROWSER_TEST_F(NotificationTest, TestKeepSizeState) { EXPECT_EQ(NotificationPanel::STICKY_AND_NEW, tester->state()); panel->OnMouseMotion(gfx::Point(10, 10)); - EXPECT_EQ(NotificationPanel::KEEP_SIZE, tester->state()); + EXPECT_EQ(NotificationPanel::STICKY_AND_NEW, tester->state()); collection->RemoveById("1"); ui_test_utils::RunAllPendingInMessageLoop(); EXPECT_EQ(1, tester->GetNewNotificationCount()); EXPECT_EQ(1, tester->GetNotificationCount()); - EXPECT_EQ(NotificationPanel::KEEP_SIZE, tester->state()); + EXPECT_EQ(NotificationPanel::STICKY_AND_NEW, tester->state()); collection->Add(NewMockNotification("1"), browser()->profile()); ui_test_utils::RunAllPendingInMessageLoop(); EXPECT_EQ(2, tester->GetNewNotificationCount()); EXPECT_EQ(2, tester->GetNotificationCount()); - EXPECT_EQ(NotificationPanel::KEEP_SIZE, tester->state()); + EXPECT_EQ(NotificationPanel::STICKY_AND_NEW, tester->state()); collection->RemoveById("1"); ui_test_utils::RunAllPendingInMessageLoop(); EXPECT_EQ(1, tester->GetNewNotificationCount()); EXPECT_EQ(1, tester->GetNotificationCount()); - EXPECT_EQ(NotificationPanel::KEEP_SIZE, tester->state()); + EXPECT_EQ(NotificationPanel::STICKY_AND_NEW, tester->state()); collection->RemoveById("2"); ui_test_utils::RunAllPendingInMessageLoop(); diff --git a/chrome/browser/chromeos/notifications/notification_panel.cc b/chrome/browser/chromeos/notifications/notification_panel.cc index a39df52..eee95fd 100644 --- a/chrome/browser/chromeos/notifications/notification_panel.cc +++ b/chrome/browser/chromeos/notifications/notification_panel.cc @@ -651,11 +651,15 @@ void NotificationPanel::OnMouseLeave() { void NotificationPanel::OnMouseMotion(const gfx::Point& point) { SetActiveView(balloon_container_->FindBalloonView(point)); - SET_STATE(KEEP_SIZE); // We need to set the focus to scroll view to get mouse wheel // working. Setting focus when mouse moves on the panel // because focus may be taken by other view. scroll_view_->RequestFocus(); + // This method used to set KEEP_SIZE state. However, + // some html notifications may want to change their size, + // and setting KEEP_SIZE caused them to behave differently + // depending on whether user moved mouse over notification + // or not. } NotificationPanelTester* NotificationPanel::GetTester() { |