| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 panel_->MarkStale(notification); | 841 panel_->MarkStale(notification); |
| 842 } | 842 } |
| 843 | 843 |
| 844 PanelController* NotificationPanelTester::GetPanelController() const { | 844 PanelController* NotificationPanelTester::GetPanelController() const { |
| 845 return panel_->panel_controller_.get(); | 845 return panel_->panel_controller_.get(); |
| 846 } | 846 } |
| 847 | 847 |
| 848 BalloonViewImpl* NotificationPanelTester::GetBalloonView( | 848 BalloonViewImpl* NotificationPanelTester::GetBalloonView( |
| 849 BalloonCollectionImpl* collection, | 849 BalloonCollectionImpl* collection, |
| 850 const Notification& notification) { | 850 const Notification& notification) { |
| 851 BalloonCollectionImpl::Balloons::iterator iter = | 851 Balloon* balloon = collection->FindBalloon(notification); |
| 852 collection->FindBalloon(notification); | 852 DCHECK(balloon); |
| 853 DCHECK(iter != collection->balloons_.end()); | |
| 854 Balloon* balloon = (*iter); | |
| 855 return GetBalloonViewOf(balloon); | 853 return GetBalloonViewOf(balloon); |
| 856 } | 854 } |
| 857 | 855 |
| 858 bool NotificationPanelTester::IsVisible(const BalloonViewImpl* view) const { | 856 bool NotificationPanelTester::IsVisible(const BalloonViewImpl* view) const { |
| 859 gfx::Rect rect = panel_->scroll_view_->GetVisibleRect(); | 857 gfx::Rect rect = panel_->scroll_view_->GetVisibleRect(); |
| 860 gfx::Point origin(0, 0); | 858 gfx::Point origin(0, 0); |
| 861 views::View::ConvertPointToView(view, panel_->balloon_container_.get(), | 859 views::View::ConvertPointToView(view, panel_->balloon_container_.get(), |
| 862 &origin); | 860 &origin); |
| 863 return rect.Contains(gfx::Rect(origin, view->bounds().size())); | 861 return rect.Contains(gfx::Rect(origin, view->bounds().size())); |
| 864 } | 862 } |
| 865 | 863 |
| 866 | 864 |
| 867 bool NotificationPanelTester::IsActive(const BalloonViewImpl* view) const { | 865 bool NotificationPanelTester::IsActive(const BalloonViewImpl* view) const { |
| 868 return panel_->active_ == view; | 866 return panel_->active_ == view; |
| 869 } | 867 } |
| 870 | 868 |
| 871 } // namespace chromeos | 869 } // namespace chromeos |
| OLD | NEW |