| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf/shelf.h" | 5 #include "ash/shelf/shelf.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "ash/focus_cycler.h" | 10 #include "ash/focus_cycler.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 // There are two ways how found_index can be valid: a.) the nth item was | 171 // There are two ways how found_index can be valid: a.) the nth item was |
| 172 // found (which is true when indexes_left is -1) or b.) the last item was | 172 // found (which is true when indexes_left is -1) or b.) the last item was |
| 173 // requested (which is true when index was passed in as a negative number). | 173 // requested (which is true when index was passed in as a negative number). |
| 174 if (found_index >= 0 && (indexes_left == -1 || item_index < 0)) { | 174 if (found_index >= 0 && (indexes_left == -1 || item_index < 0)) { |
| 175 // Then set this one as active (or advance to the next item of its kind). | 175 // Then set this one as active (or advance to the next item of its kind). |
| 176 ActivateShelfItem(found_index); | 176 ActivateShelfItem(found_index); |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 | 179 |
| 180 void Shelf::SetShelfViewBounds(gfx::Rect bounds) { | |
| 181 shelf_view_->SetBoundsRect(bounds); | |
| 182 } | |
| 183 | |
| 184 gfx::Rect Shelf::GetShelfViewBounds() const { | |
| 185 return shelf_view_->bounds(); | |
| 186 } | |
| 187 | |
| 188 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { | 180 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { |
| 189 return shelf_view_->GetVisibleItemsBoundsInScreen(); | 181 return shelf_view_->GetVisibleItemsBoundsInScreen(); |
| 190 } | 182 } |
| 191 | 183 |
| 192 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { | 184 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { |
| 193 return shelf_view_; | 185 return shelf_view_; |
| 194 } | 186 } |
| 195 | 187 |
| 196 } // namespace ash | 188 } // namespace ash |
| OLD | NEW |