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 #include "chrome/browser/notifications/balloon_collection_impl.h" | 5 #include "chrome/browser/notifications/balloon_collection_impl.h" |
6 | 6 |
7 #include "chrome/browser/notifications/balloon.h" | 7 #include "chrome/browser/notifications/balloon.h" |
8 #include "chrome/browser/ui/views/notifications/balloon_view.h" | 8 #include "chrome/browser/ui/views/notifications/balloon_view.h" |
9 #include "ui/base/events.h" | 9 #include "ui/base/events.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 | 25 |
26 int BalloonCollectionImpl::Layout::HorizontalEdgeMargin() const { | 26 int BalloonCollectionImpl::Layout::HorizontalEdgeMargin() const { |
27 return 2; | 27 return 2; |
28 } | 28 } |
29 | 29 |
30 int BalloonCollectionImpl::Layout::VerticalEdgeMargin() const { | 30 int BalloonCollectionImpl::Layout::VerticalEdgeMargin() const { |
31 return 0; | 31 return 0; |
32 } | 32 } |
33 | 33 |
| 34 bool BalloonCollectionImpl::Layout::NeedToMoveAboveLeftSidePanels() const { |
| 35 return placement_ == VERTICALLY_FROM_BOTTOM_LEFT; |
| 36 } |
| 37 |
| 38 bool BalloonCollectionImpl::Layout::NeedToMoveAboveRightSidePanels() const { |
| 39 return placement_ == VERTICALLY_FROM_BOTTOM_RIGHT; |
| 40 } |
| 41 |
34 void BalloonCollectionImpl::PositionBalloons(bool reposition) { | 42 void BalloonCollectionImpl::PositionBalloons(bool reposition) { |
35 PositionBalloonsInternal(reposition); | 43 PositionBalloonsInternal(reposition); |
36 } | 44 } |
37 | 45 |
38 base::EventStatus BalloonCollectionImpl::WillProcessEvent( | 46 base::EventStatus BalloonCollectionImpl::WillProcessEvent( |
39 const base::NativeEvent& event) { | 47 const base::NativeEvent& event) { |
40 return base::EVENT_CONTINUE; | 48 return base::EVENT_CONTINUE; |
41 } | 49 } |
42 | 50 |
43 void BalloonCollectionImpl::DidProcessEvent(const base::NativeEvent& event) { | 51 void BalloonCollectionImpl::DidProcessEvent(const base::NativeEvent& event) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 layout_.set_placement(Layout::VERTICALLY_FROM_TOP_RIGHT); | 97 layout_.set_placement(Layout::VERTICALLY_FROM_TOP_RIGHT); |
90 else if (position == UPPER_LEFT) | 98 else if (position == UPPER_LEFT) |
91 layout_.set_placement(Layout::VERTICALLY_FROM_TOP_LEFT); | 99 layout_.set_placement(Layout::VERTICALLY_FROM_TOP_LEFT); |
92 else if (position == LOWER_LEFT) | 100 else if (position == LOWER_LEFT) |
93 layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_LEFT); | 101 layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_LEFT); |
94 else if (position == LOWER_RIGHT) | 102 else if (position == LOWER_RIGHT) |
95 layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_RIGHT); | 103 layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_RIGHT); |
96 else | 104 else |
97 NOTREACHED(); | 105 NOTREACHED(); |
98 | 106 |
| 107 layout_.ComputeOffsetToMoveAbovePanels(gfx::Rect()); |
99 PositionBalloons(true); | 108 PositionBalloons(true); |
100 } | 109 } |
101 | 110 |
102 // static | 111 // static |
103 BalloonCollection* BalloonCollection::Create() { | 112 BalloonCollection* BalloonCollection::Create() { |
104 return new BalloonCollectionImpl(); | 113 return new BalloonCollectionImpl(); |
105 } | 114 } |
OLD | NEW |