| 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/common/shelf/overflow_button.h" | 7 #include "ash/common/shelf/overflow_button.h" |
| 8 #include "ash/common/shelf/shelf_button.h" | 8 #include "ash/common/shelf/shelf_button.h" |
| 9 #include "ash/common/shelf/shelf_constants.h" | 9 #include "ash/common/shelf/shelf_constants.h" |
| 10 #include "ash/common/shelf/shelf_model.h" | 10 #include "ash/common/shelf/shelf_model.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 bool ShelfViewTestAPI::IsOverflowButtonVisible() { | 65 bool ShelfViewTestAPI::IsOverflowButtonVisible() { |
| 66 return shelf_view_->overflow_button_->visible(); | 66 return shelf_view_->overflow_button_->visible(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void ShelfViewTestAPI::ShowOverflowBubble() { | 69 void ShelfViewTestAPI::ShowOverflowBubble() { |
| 70 if (!shelf_view_->IsShowingOverflowBubble()) | 70 if (!shelf_view_->IsShowingOverflowBubble()) |
| 71 shelf_view_->ToggleOverflowBubble(); | 71 shelf_view_->ToggleOverflowBubble(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void ShelfViewTestAPI::HideOverflowBubble() { |
| 75 if (shelf_view_->IsShowingOverflowBubble()) |
| 76 shelf_view_->ToggleOverflowBubble(); |
| 77 } |
| 78 |
| 74 const gfx::Rect& ShelfViewTestAPI::GetBoundsByIndex(int index) { | 79 const gfx::Rect& ShelfViewTestAPI::GetBoundsByIndex(int index) { |
| 75 return shelf_view_->view_model_->view_at(index)->bounds(); | 80 return shelf_view_->view_model_->view_at(index)->bounds(); |
| 76 } | 81 } |
| 77 | 82 |
| 78 const gfx::Rect& ShelfViewTestAPI::GetIdealBoundsByIndex(int index) { | 83 const gfx::Rect& ShelfViewTestAPI::GetIdealBoundsByIndex(int index) { |
| 79 return shelf_view_->view_model_->ideal_bounds(index); | 84 return shelf_view_->view_model_->ideal_bounds(index); |
| 80 } | 85 } |
| 81 | 86 |
| 82 void ShelfViewTestAPI::SetAnimationDuration(int duration_ms) { | 87 void ShelfViewTestAPI::SetAnimationDuration(int duration_ms) { |
| 83 shelf_view_->bounds_animator_->SetAnimationDuration(duration_ms); | 88 shelf_view_->bounds_animator_->SetAnimationDuration(duration_ms); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 102 if (!shelf_view_->launcher_menu_runner_) | 107 if (!shelf_view_->launcher_menu_runner_) |
| 103 return; | 108 return; |
| 104 | 109 |
| 105 shelf_view_->launcher_menu_runner_->Cancel(); | 110 shelf_view_->launcher_menu_runner_->Cancel(); |
| 106 } | 111 } |
| 107 | 112 |
| 108 OverflowBubble* ShelfViewTestAPI::overflow_bubble() { | 113 OverflowBubble* ShelfViewTestAPI::overflow_bubble() { |
| 109 return shelf_view_->overflow_bubble_.get(); | 114 return shelf_view_->overflow_bubble_.get(); |
| 110 } | 115 } |
| 111 | 116 |
| 117 OverflowButton* ShelfViewTestAPI::overflow_button() const { |
| 118 return shelf_view_->overflow_button_; |
| 119 } |
| 120 |
| 112 ShelfTooltipManager* ShelfViewTestAPI::tooltip_manager() { | 121 ShelfTooltipManager* ShelfViewTestAPI::tooltip_manager() { |
| 113 return &shelf_view_->tooltip_; | 122 return &shelf_view_->tooltip_; |
| 114 } | 123 } |
| 115 | 124 |
| 116 gfx::Size ShelfViewTestAPI::GetPreferredSize() { | 125 gfx::Size ShelfViewTestAPI::GetPreferredSize() { |
| 117 return shelf_view_->GetPreferredSize(); | 126 return shelf_view_->GetPreferredSize(); |
| 118 } | 127 } |
| 119 | 128 |
| 120 int ShelfViewTestAPI::GetButtonSize() { | 129 int ShelfViewTestAPI::GetButtonSize() { |
| 121 return GetShelfConstant(SHELF_BUTTON_SIZE); | 130 return GetShelfConstant(SHELF_BUTTON_SIZE); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return shelf_view_->dragged_off_from_overflow_to_shelf_; | 165 return shelf_view_->dragged_off_from_overflow_to_shelf_; |
| 157 } | 166 } |
| 158 | 167 |
| 159 ShelfButtonPressedMetricTracker* | 168 ShelfButtonPressedMetricTracker* |
| 160 ShelfViewTestAPI::shelf_button_pressed_metric_tracker() { | 169 ShelfViewTestAPI::shelf_button_pressed_metric_tracker() { |
| 161 return &(shelf_view_->shelf_button_pressed_metric_tracker_); | 170 return &(shelf_view_->shelf_button_pressed_metric_tracker_); |
| 162 } | 171 } |
| 163 | 172 |
| 164 } // namespace test | 173 } // namespace test |
| 165 } // namespace ash | 174 } // namespace ash |
| OLD | NEW |