| 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/launcher/launcher.h" | 5 #include "ash/launcher/launcher.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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 for (int i = 0; i < item_count && indexes_left >= 0; i++) { | 162 for (int i = 0; i < item_count && indexes_left >= 0; i++) { |
| 163 if (items[i].type != TYPE_APP_LIST) { | 163 if (items[i].type != TYPE_APP_LIST) { |
| 164 found_index = i; | 164 found_index = i; |
| 165 indexes_left--; | 165 indexes_left--; |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 // There are two ways how found_index can be valid: a.) the nth item was | 169 // There are two ways how found_index can be valid: a.) the nth item was |
| 170 // found (which is true when indexes_left is -1) or b.) the last item was | 170 // found (which is true when indexes_left is -1) or b.) the last item was |
| 171 // requested (which is true when index was passed in as a negative number). | 171 // requested (which is true when index was passed in as a negative number). |
| 172 if (found_index >= 0 && (indexes_left == -1 || item_index < 0) && | 172 if (found_index >= 0 && (indexes_left == -1 || item_index < 0)) { |
| 173 (delegate_->IsPerAppLauncher() || | |
| 174 (items[found_index].status == ash::STATUS_RUNNING || | |
| 175 items[found_index].status == ash::STATUS_CLOSED))) { | |
| 176 // Then set this one as active (or advance to the next item of its kind). | 173 // Then set this one as active (or advance to the next item of its kind). |
| 177 ActivateLauncherItem(found_index); | 174 ActivateLauncherItem(found_index); |
| 178 } | 175 } |
| 179 } | 176 } |
| 180 | 177 |
| 181 internal::LauncherView* Launcher::GetLauncherViewForTest() { | 178 internal::LauncherView* Launcher::GetLauncherViewForTest() { |
| 182 return launcher_view_; | 179 return launcher_view_; |
| 183 } | 180 } |
| 184 | 181 |
| 185 void Launcher::SetLauncherViewBounds(gfx::Rect bounds) { | 182 void Launcher::SetLauncherViewBounds(gfx::Rect bounds) { |
| 186 launcher_view_->SetBoundsRect(bounds); | 183 launcher_view_->SetBoundsRect(bounds); |
| 187 } | 184 } |
| 188 | 185 |
| 189 gfx::Rect Launcher::GetLauncherViewBounds() const { | 186 gfx::Rect Launcher::GetLauncherViewBounds() const { |
| 190 return launcher_view_->bounds(); | 187 return launcher_view_->bounds(); |
| 191 } | 188 } |
| 192 | 189 |
| 193 app_list::ApplicationDragAndDropHost* Launcher::GetDragAndDropHostForAppList() { | 190 app_list::ApplicationDragAndDropHost* Launcher::GetDragAndDropHostForAppList() { |
| 194 return launcher_view_; | 191 return launcher_view_; |
| 195 } | 192 } |
| 196 | 193 |
| 197 } // namespace ash | 194 } // namespace ash |
| OLD | NEW |