| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Draws the view for the balloons. | 5 // Draws the view for the balloons. |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/notifications/notification_panel.h" | 7 #include "chrome/browser/chromeos/notifications/notification_panel.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 | 644 |
| 645 void NotificationPanel::OnMouseLeave() { | 645 void NotificationPanel::OnMouseLeave() { |
| 646 SetActiveView(NULL); | 646 SetActiveView(NULL); |
| 647 if (balloon_container_->GetNotificationCount() == 0) | 647 if (balloon_container_->GetNotificationCount() == 0) |
| 648 SET_STATE(CLOSED); | 648 SET_STATE(CLOSED); |
| 649 UpdatePanel(true); | 649 UpdatePanel(true); |
| 650 } | 650 } |
| 651 | 651 |
| 652 void NotificationPanel::OnMouseMotion(const gfx::Point& point) { | 652 void NotificationPanel::OnMouseMotion(const gfx::Point& point) { |
| 653 SetActiveView(balloon_container_->FindBalloonView(point)); | 653 SetActiveView(balloon_container_->FindBalloonView(point)); |
| 654 SET_STATE(KEEP_SIZE); | |
| 655 // We need to set the focus to scroll view to get mouse wheel | 654 // We need to set the focus to scroll view to get mouse wheel |
| 656 // working. Setting focus when mouse moves on the panel | 655 // working. Setting focus when mouse moves on the panel |
| 657 // because focus may be taken by other view. | 656 // because focus may be taken by other view. |
| 658 scroll_view_->RequestFocus(); | 657 scroll_view_->RequestFocus(); |
| 658 // This method used to set KEEP_SIZE state. However, |
| 659 // some html notifications may want to change their size, |
| 660 // and setting KEEP_SIZE caused them to behave differently |
| 661 // depending on whether user moved mouse over notification |
| 662 // or not. |
| 659 } | 663 } |
| 660 | 664 |
| 661 NotificationPanelTester* NotificationPanel::GetTester() { | 665 NotificationPanelTester* NotificationPanel::GetTester() { |
| 662 if (!tester_.get()) | 666 if (!tester_.get()) |
| 663 tester_.reset(new NotificationPanelTester(this)); | 667 tester_.reset(new NotificationPanelTester(this)); |
| 664 return tester_.get(); | 668 return tester_.get(); |
| 665 } | 669 } |
| 666 | 670 |
| 667 //////////////////////////////////////////////////////////////////////////////// | 671 //////////////////////////////////////////////////////////////////////////////// |
| 668 // NotificationPanel private. | 672 // NotificationPanel private. |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 &origin); | 866 &origin); |
| 863 return rect.Contains(gfx::Rect(origin, view->size())); | 867 return rect.Contains(gfx::Rect(origin, view->size())); |
| 864 } | 868 } |
| 865 | 869 |
| 866 | 870 |
| 867 bool NotificationPanelTester::IsActive(const BalloonViewImpl* view) const { | 871 bool NotificationPanelTester::IsActive(const BalloonViewImpl* view) const { |
| 868 return panel_->active_ == view; | 872 return panel_->active_ == view; |
| 869 } | 873 } |
| 870 | 874 |
| 871 } // namespace chromeos | 875 } // namespace chromeos |
| OLD | NEW |