Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: ash/test/shelf_view_test_api.cc

Issue 2575613002: Remove ShelfItemDelegate::IsDraggable; check for app list button. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 ShelfViewTestAPI::~ShelfViewTestAPI() {} 44 ShelfViewTestAPI::~ShelfViewTestAPI() {}
45 45
46 int ShelfViewTestAPI::GetButtonCount() { 46 int ShelfViewTestAPI::GetButtonCount() {
47 return shelf_view_->view_model_->view_size(); 47 return shelf_view_->view_model_->view_size();
48 } 48 }
49 49
50 ShelfButton* ShelfViewTestAPI::GetButton(int index) { 50 ShelfButton* ShelfViewTestAPI::GetButton(int index) {
51 // App list button is not a ShelfButton. 51 // App list button is not a ShelfButton.
52 if (shelf_view_->model_->items()[index].type == ash::TYPE_APP_LIST) 52 if (shelf_view_->model_->items()[index].type == ash::TYPE_APP_LIST)
53 return NULL; 53 return nullptr;
54 54
55 return static_cast<ShelfButton*>(shelf_view_->view_model_->view_at(index)); 55 return static_cast<ShelfButton*>(GetViewAt(index));
56 }
57
58 views::View* ShelfViewTestAPI::GetViewAt(int index) {
59 return shelf_view_->view_model_->view_at(index);
56 } 60 }
57 61
58 int ShelfViewTestAPI::GetFirstVisibleIndex() { 62 int ShelfViewTestAPI::GetFirstVisibleIndex() {
59 return shelf_view_->first_visible_index_; 63 return shelf_view_->first_visible_index_;
60 } 64 }
61 65
62 int ShelfViewTestAPI::GetLastVisibleIndex() { 66 int ShelfViewTestAPI::GetLastVisibleIndex() {
63 return shelf_view_->last_visible_index_; 67 return shelf_view_->last_visible_index_;
64 } 68 }
65 69
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 return shelf_view_->dragged_off_from_overflow_to_shelf_; 174 return shelf_view_->dragged_off_from_overflow_to_shelf_;
171 } 175 }
172 176
173 ShelfButtonPressedMetricTracker* 177 ShelfButtonPressedMetricTracker*
174 ShelfViewTestAPI::shelf_button_pressed_metric_tracker() { 178 ShelfViewTestAPI::shelf_button_pressed_metric_tracker() {
175 return &(shelf_view_->shelf_button_pressed_metric_tracker_); 179 return &(shelf_view_->shelf_button_pressed_metric_tracker_);
176 } 180 }
177 181
178 } // namespace test 182 } // namespace test
179 } // namespace ash 183 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698