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/shelf_constants.h" | 7 #include "ash/common/shelf/shelf_constants.h" |
8 #include "ash/common/shelf/shelf_model.h" | 8 #include "ash/common/shelf/shelf_model.h" |
9 #include "ash/shelf/overflow_button.h" | 9 #include "ash/shelf/overflow_button.h" |
10 #include "ash/shelf/shelf_button.h" | 10 #include "ash/shelf/shelf_button.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 }; | 33 }; |
34 | 34 |
35 } // namespace | 35 } // namespace |
36 | 36 |
37 namespace ash { | 37 namespace ash { |
38 namespace test { | 38 namespace test { |
39 | 39 |
40 ShelfViewTestAPI::ShelfViewTestAPI(ShelfView* shelf_view) | 40 ShelfViewTestAPI::ShelfViewTestAPI(ShelfView* shelf_view) |
41 : shelf_view_(shelf_view) {} | 41 : shelf_view_(shelf_view) {} |
42 | 42 |
43 ShelfViewTestAPI::~ShelfViewTestAPI() { | 43 ShelfViewTestAPI::~ShelfViewTestAPI() {} |
44 } | |
45 | 44 |
46 int ShelfViewTestAPI::GetButtonCount() { | 45 int ShelfViewTestAPI::GetButtonCount() { |
47 return shelf_view_->view_model_->view_size(); | 46 return shelf_view_->view_model_->view_size(); |
48 } | 47 } |
49 | 48 |
50 ShelfButton* ShelfViewTestAPI::GetButton(int index) { | 49 ShelfButton* ShelfViewTestAPI::GetButton(int index) { |
51 // App list button is not a ShelfButton. | 50 // App list button is not a ShelfButton. |
52 if (shelf_view_->model_->items()[index].type == ash::TYPE_APP_LIST) | 51 if (shelf_view_->model_->items()[index].type == ash::TYPE_APP_LIST) |
53 return NULL; | 52 return NULL; |
54 | 53 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 146 |
148 gfx::Rect ShelfViewTestAPI::GetBoundsForDragInsertInScreen() { | 147 gfx::Rect ShelfViewTestAPI::GetBoundsForDragInsertInScreen() { |
149 return shelf_view_->GetBoundsForDragInsertInScreen(); | 148 return shelf_view_->GetBoundsForDragInsertInScreen(); |
150 } | 149 } |
151 | 150 |
152 bool ShelfViewTestAPI::IsRippedOffFromShelf() { | 151 bool ShelfViewTestAPI::IsRippedOffFromShelf() { |
153 return shelf_view_->dragged_off_shelf_; | 152 return shelf_view_->dragged_off_shelf_; |
154 } | 153 } |
155 | 154 |
156 bool ShelfViewTestAPI::DraggedItemFromOverflowToShelf() { | 155 bool ShelfViewTestAPI::DraggedItemFromOverflowToShelf() { |
157 return shelf_view_->dragged_off_from_overflow_to_shelf_; | 156 return shelf_view_->dragged_off_from_overflow_to_shelf_; |
158 } | 157 } |
159 | 158 |
160 ShelfButtonPressedMetricTracker* | 159 ShelfButtonPressedMetricTracker* |
161 ShelfViewTestAPI::shelf_button_pressed_metric_tracker() { | 160 ShelfViewTestAPI::shelf_button_pressed_metric_tracker() { |
162 return &(shelf_view_->shelf_button_pressed_metric_tracker_); | 161 return &(shelf_view_->shelf_button_pressed_metric_tracker_); |
163 } | 162 } |
164 | 163 |
165 } // namespace test | 164 } // namespace test |
166 } // namespace ash | 165 } // namespace ash |
OLD | NEW |