| 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 "ui/gfx/size.h" | 8 #include "ui/gfx/size.h" |
| 9 | 9 |
| 10 #if defined(TOOLKIT_VIEWS) | 10 #if defined(TOOLKIT_VIEWS) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 int BalloonCollectionImpl::Layout::HorizontalEdgeMargin() const { | 30 int BalloonCollectionImpl::Layout::HorizontalEdgeMargin() const { |
| 31 return 5; | 31 return 5; |
| 32 } | 32 } |
| 33 | 33 |
| 34 int BalloonCollectionImpl::Layout::VerticalEdgeMargin() const { | 34 int BalloonCollectionImpl::Layout::VerticalEdgeMargin() const { |
| 35 return 5; | 35 return 5; |
| 36 } | 36 } |
| 37 | 37 |
| 38 bool BalloonCollectionImpl::Layout::NeedToMoveAboveLeftSidePanels() const { |
| 39 return placement_ == VERTICALLY_FROM_BOTTOM_LEFT; |
| 40 } |
| 41 |
| 42 bool BalloonCollectionImpl::Layout::NeedToMoveAboveRightSidePanels() const { |
| 43 return placement_ == VERTICALLY_FROM_BOTTOM_RIGHT; |
| 44 } |
| 45 |
| 38 void BalloonCollectionImpl::PositionBalloons(bool reposition) { | 46 void BalloonCollectionImpl::PositionBalloons(bool reposition) { |
| 39 PositionBalloonsInternal(reposition); | 47 PositionBalloonsInternal(reposition); |
| 40 } | 48 } |
| 41 | 49 |
| 42 #if defined(TOUCH_UI) | 50 #if defined(TOUCH_UI) |
| 43 base::EventStatus BalloonCollectionImpl::WillProcessEvent( | 51 base::EventStatus BalloonCollectionImpl::WillProcessEvent( |
| 44 const base::NativeEvent& event) { | 52 const base::NativeEvent& event) { |
| 45 return base::EVENT_CONTINUE; | 53 return base::EVENT_CONTINUE; |
| 46 } | 54 } |
| 47 | 55 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 layout_.set_placement(Layout::VERTICALLY_FROM_TOP_RIGHT); | 93 layout_.set_placement(Layout::VERTICALLY_FROM_TOP_RIGHT); |
| 86 else if (position == UPPER_LEFT) | 94 else if (position == UPPER_LEFT) |
| 87 layout_.set_placement(Layout::VERTICALLY_FROM_TOP_LEFT); | 95 layout_.set_placement(Layout::VERTICALLY_FROM_TOP_LEFT); |
| 88 else if (position == LOWER_LEFT) | 96 else if (position == LOWER_LEFT) |
| 89 layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_LEFT); | 97 layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_LEFT); |
| 90 else if (position == LOWER_RIGHT) | 98 else if (position == LOWER_RIGHT) |
| 91 layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_RIGHT); | 99 layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_RIGHT); |
| 92 else | 100 else |
| 93 NOTREACHED(); | 101 NOTREACHED(); |
| 94 | 102 |
| 103 layout_.ComputeOffsetToMoveAbovePanels(gfx::Rect()); |
| 95 PositionBalloons(true); | 104 PositionBalloons(true); |
| 96 } | 105 } |
| 97 | 106 |
| 98 // static | 107 // static |
| 99 BalloonCollection* BalloonCollection::Create() { | 108 BalloonCollection* BalloonCollection::Create() { |
| 100 return new BalloonCollectionImpl(); | 109 return new BalloonCollectionImpl(); |
| 101 } | 110 } |
| OLD | NEW |