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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 views::View::ConvertPointToScreen(launcher_view_, &screen_origin); | 354 views::View::ConvertPointToScreen(launcher_view_, &screen_origin); |
355 return gfx::Rect(screen_origin.x() + bounds.x(), | 355 return gfx::Rect(screen_origin.x() + bounds.x(), |
356 screen_origin.y() + bounds.y(), | 356 screen_origin.y() + bounds.y(), |
357 bounds.width(), | 357 bounds.width(), |
358 bounds.height()); | 358 bounds.height()); |
359 } | 359 } |
360 | 360 |
361 void Launcher::ActivateLauncherItem(int index) { | 361 void Launcher::ActivateLauncherItem(int index) { |
362 const ash::LauncherItems& items = | 362 const ash::LauncherItems& items = |
363 launcher_view_->model()->items(); | 363 launcher_view_->model()->items(); |
364 delegate_->ItemClicked(items[index], ui::EF_NONE); | 364 ui::MouseEvent event(ui::ET_MOUSE_PRESSED, |
| 365 gfx::Point(), |
| 366 gfx::Point(), |
| 367 ui::EF_NONE); |
| 368 delegate_->ItemClicked(items[index], event); |
365 } | 369 } |
366 | 370 |
367 void Launcher::CycleWindowLinear(CycleDirection direction) { | 371 void Launcher::CycleWindowLinear(CycleDirection direction) { |
368 int item_index = GetNextActivatedItemIndex( | 372 int item_index = GetNextActivatedItemIndex( |
369 *(launcher_view_->model()), direction); | 373 *(launcher_view_->model()), direction); |
370 if (item_index >= 0) | 374 if (item_index >= 0) |
371 ActivateLauncherItem(item_index); | 375 ActivateLauncherItem(item_index); |
372 } | 376 } |
373 | 377 |
374 void Launcher::AddIconObserver(LauncherIconObserver* observer) { | 378 void Launcher::AddIconObserver(LauncherIconObserver* observer) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 } else { | 444 } else { |
441 delegate_view_->GetFocusManager()->ClearFocus(); | 445 delegate_view_->GetFocusManager()->ClearFocus(); |
442 } | 446 } |
443 } | 447 } |
444 | 448 |
445 internal::LauncherView* Launcher::GetLauncherViewForTest() { | 449 internal::LauncherView* Launcher::GetLauncherViewForTest() { |
446 return launcher_view_; | 450 return launcher_view_; |
447 } | 451 } |
448 | 452 |
449 } // namespace ash | 453 } // namespace ash |
OLD | NEW |