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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 | 65 |
66 bool ShelfViewTestAPI::IsOverflowButtonVisible() { | 66 bool ShelfViewTestAPI::IsOverflowButtonVisible() { |
67 return shelf_view_->overflow_button_->visible(); | 67 return shelf_view_->overflow_button_->visible(); |
68 } | 68 } |
69 | 69 |
70 void ShelfViewTestAPI::ShowOverflowBubble() { | 70 void ShelfViewTestAPI::ShowOverflowBubble() { |
71 if (!shelf_view_->IsShowingOverflowBubble()) | 71 if (!shelf_view_->IsShowingOverflowBubble()) |
72 shelf_view_->ToggleOverflowBubble(); | 72 shelf_view_->ToggleOverflowBubble(); |
73 } | 73 } |
74 | 74 |
75 void ShelfViewTestAPI::HideOverflowBubble() { | |
76 if (shelf_view_->IsShowingOverflowBubble()) | |
bruthig
2016/09/01 16:12:54
Can you make this a DCHECK instead of an if? It i
mohsen
2016/09/10 03:03:23
Done. Also, for the ShowOverflowBubble().
| |
77 shelf_view_->ToggleOverflowBubble(); | |
78 } | |
79 | |
75 const gfx::Rect& ShelfViewTestAPI::GetBoundsByIndex(int index) { | 80 const gfx::Rect& ShelfViewTestAPI::GetBoundsByIndex(int index) { |
76 return shelf_view_->view_model_->view_at(index)->bounds(); | 81 return shelf_view_->view_model_->view_at(index)->bounds(); |
77 } | 82 } |
78 | 83 |
79 const gfx::Rect& ShelfViewTestAPI::GetIdealBoundsByIndex(int index) { | 84 const gfx::Rect& ShelfViewTestAPI::GetIdealBoundsByIndex(int index) { |
80 return shelf_view_->view_model_->ideal_bounds(index); | 85 return shelf_view_->view_model_->ideal_bounds(index); |
81 } | 86 } |
82 | 87 |
83 void ShelfViewTestAPI::SetAnimationDuration(int duration_ms) { | 88 void ShelfViewTestAPI::SetAnimationDuration(int duration_ms) { |
84 shelf_view_->bounds_animator_->SetAnimationDuration(duration_ms); | 89 shelf_view_->bounds_animator_->SetAnimationDuration(duration_ms); |
(...skipping 18 matching lines...) Expand all Loading... | |
103 if (!shelf_view_->launcher_menu_runner_) | 108 if (!shelf_view_->launcher_menu_runner_) |
104 return; | 109 return; |
105 | 110 |
106 shelf_view_->launcher_menu_runner_->Cancel(); | 111 shelf_view_->launcher_menu_runner_->Cancel(); |
107 } | 112 } |
108 | 113 |
109 OverflowBubble* ShelfViewTestAPI::overflow_bubble() { | 114 OverflowBubble* ShelfViewTestAPI::overflow_bubble() { |
110 return shelf_view_->overflow_bubble_.get(); | 115 return shelf_view_->overflow_bubble_.get(); |
111 } | 116 } |
112 | 117 |
118 OverflowButton* ShelfViewTestAPI::overflow_button() const { | |
119 return shelf_view_->overflow_button_; | |
120 } | |
121 | |
113 ShelfTooltipManager* ShelfViewTestAPI::tooltip_manager() { | 122 ShelfTooltipManager* ShelfViewTestAPI::tooltip_manager() { |
114 return &shelf_view_->tooltip_; | 123 return &shelf_view_->tooltip_; |
115 } | 124 } |
116 | 125 |
117 gfx::Size ShelfViewTestAPI::GetPreferredSize() { | 126 gfx::Size ShelfViewTestAPI::GetPreferredSize() { |
118 return shelf_view_->GetPreferredSize(); | 127 return shelf_view_->GetPreferredSize(); |
119 } | 128 } |
120 | 129 |
121 int ShelfViewTestAPI::GetButtonSize() { | 130 int ShelfViewTestAPI::GetButtonSize() { |
122 return GetShelfConstant(SHELF_BUTTON_SIZE); | 131 return GetShelfConstant(SHELF_BUTTON_SIZE); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 return shelf_view_->dragged_off_from_overflow_to_shelf_; | 166 return shelf_view_->dragged_off_from_overflow_to_shelf_; |
158 } | 167 } |
159 | 168 |
160 ShelfButtonPressedMetricTracker* | 169 ShelfButtonPressedMetricTracker* |
161 ShelfViewTestAPI::shelf_button_pressed_metric_tracker() { | 170 ShelfViewTestAPI::shelf_button_pressed_metric_tracker() { |
162 return &(shelf_view_->shelf_button_pressed_metric_tracker_); | 171 return &(shelf_view_->shelf_button_pressed_metric_tracker_); |
163 } | 172 } |
164 | 173 |
165 } // namespace test | 174 } // namespace test |
166 } // namespace ash | 175 } // namespace ash |
OLD | NEW |