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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
643 // PanelController public. | 643 // PanelController public. |
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)); |
oshima
2011/08/26 18:17:46
Can you add comment that this used to set the stat
dgozman
2011/08/29 07:03:17
Done.
| |
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(); |
659 } | 658 } |
660 | 659 |
661 NotificationPanelTester* NotificationPanel::GetTester() { | 660 NotificationPanelTester* NotificationPanel::GetTester() { |
662 if (!tester_.get()) | 661 if (!tester_.get()) |
663 tester_.reset(new NotificationPanelTester(this)); | 662 tester_.reset(new NotificationPanelTester(this)); |
664 return tester_.get(); | 663 return tester_.get(); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
862 &origin); | 861 &origin); |
863 return rect.Contains(gfx::Rect(origin, view->size())); | 862 return rect.Contains(gfx::Rect(origin, view->size())); |
864 } | 863 } |
865 | 864 |
866 | 865 |
867 bool NotificationPanelTester::IsActive(const BalloonViewImpl* view) const { | 866 bool NotificationPanelTester::IsActive(const BalloonViewImpl* view) const { |
868 return panel_->active_ == view; | 867 return panel_->active_ == view; |
869 } | 868 } |
870 | 869 |
871 } // namespace chromeos | 870 } // namespace chromeos |
OLD | NEW |