| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/test/shelf_view_test_api.h" | 5 #include "ash/test/shelf_view_test_api.h" |
| 6 | 6 |
| 7 #include "ash/shelf/overflow_button.h" | 7 #include "ash/shelf/overflow_button.h" |
| 8 #include "ash/shelf/shelf_button.h" | 8 #include "ash/shelf/shelf_button.h" |
| 9 #include "ash/shelf/shelf_constants.h" | |
| 10 #include "ash/shelf/shelf_model.h" | 9 #include "ash/shelf/shelf_model.h" |
| 11 #include "ash/shelf/shelf_view.h" | 10 #include "ash/shelf/shelf_view.h" |
| 12 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 13 #include "ui/views/animation/bounds_animator.h" | 12 #include "ui/views/animation/bounds_animator.h" |
| 14 #include "ui/views/view_model.h" | 13 #include "ui/views/view_model.h" |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 // A class used to wait for animations. | 17 // A class used to wait for animations. |
| 19 class TestAPIAnimationObserver : public views::BoundsAnimatorObserver { | 18 class TestAPIAnimationObserver : public views::BoundsAnimatorObserver { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 101 |
| 103 internal::OverflowBubble* ShelfViewTestAPI::overflow_bubble() { | 102 internal::OverflowBubble* ShelfViewTestAPI::overflow_bubble() { |
| 104 return shelf_view_->overflow_bubble_.get(); | 103 return shelf_view_->overflow_bubble_.get(); |
| 105 } | 104 } |
| 106 | 105 |
| 107 gfx::Size ShelfViewTestAPI::GetPreferredSize() { | 106 gfx::Size ShelfViewTestAPI::GetPreferredSize() { |
| 108 return shelf_view_->GetPreferredSize(); | 107 return shelf_view_->GetPreferredSize(); |
| 109 } | 108 } |
| 110 | 109 |
| 111 int ShelfViewTestAPI::GetButtonSize() { | 110 int ShelfViewTestAPI::GetButtonSize() { |
| 112 return kShelfButtonSize; | 111 return shelf_view_->GetButtonSize(); |
| 113 } | 112 } |
| 114 | 113 |
| 115 int ShelfViewTestAPI::GetButtonSpacing() { | 114 int ShelfViewTestAPI::GetButtonSpacing() { |
| 116 return kShelfButtonSpacing; | 115 return shelf_view_->GetButtonSpacing(); |
| 117 } | 116 } |
| 118 | 117 |
| 119 bool ShelfViewTestAPI::SameDragType(ShelfItemType typea, | 118 bool ShelfViewTestAPI::SameDragType(ShelfItemType typea, |
| 120 ShelfItemType typeb) const { | 119 ShelfItemType typeb) const { |
| 121 return shelf_view_->SameDragType(typea, typeb); | 120 return shelf_view_->SameDragType(typea, typeb); |
| 122 } | 121 } |
| 123 | 122 |
| 124 void ShelfViewTestAPI::SetShelfDelegate(ShelfDelegate* delegate) { | 123 void ShelfViewTestAPI::SetShelfDelegate(ShelfDelegate* delegate) { |
| 125 shelf_view_->delegate_ = delegate; | 124 shelf_view_->delegate_ = delegate; |
| 126 } | 125 } |
| 127 | 126 |
| 128 gfx::Rect ShelfViewTestAPI::GetBoundsForDragInsertInScreen() { | 127 gfx::Rect ShelfViewTestAPI::GetBoundsForDragInsertInScreen() { |
| 129 return shelf_view_->GetBoundsForDragInsertInScreen(); | 128 return shelf_view_->GetBoundsForDragInsertInScreen(); |
| 130 } | 129 } |
| 131 | 130 |
| 132 bool ShelfViewTestAPI::IsRippedOffFromShelf() { | 131 bool ShelfViewTestAPI::IsRippedOffFromShelf() { |
| 133 return shelf_view_->dragged_off_shelf_; | 132 return shelf_view_->dragged_off_shelf_; |
| 134 } | 133 } |
| 135 | 134 |
| 136 bool ShelfViewTestAPI::DraggedItemFromOverflowToShelf() { | 135 bool ShelfViewTestAPI::DraggedItemFromOverflowToShelf() { |
| 137 return shelf_view_->dragged_off_from_overflow_to_shelf_; | 136 return shelf_view_->dragged_off_from_overflow_to_shelf_; |
| 138 } | 137 } |
| 139 | 138 |
| 140 } // namespace test | 139 } // namespace test |
| 141 } // namespace ash | 140 } // namespace ash |
| OLD | NEW |