Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 // Return true if any windows are visible. | 73 // Return true if any windows are visible. |
| 74 for (const auto* window : windows_) { | 74 for (const auto* window : windows_) { |
| 75 if (window->GetNativeWindow()->IsVisible()) | 75 if (window->GetNativeWindow()->IsVisible()) |
| 76 return true; | 76 return true; |
| 77 } | 77 } |
| 78 return false; | 78 return false; |
| 79 } | 79 } |
| 80 | 80 |
| 81 void AppWindowLauncherItemController::Launch(ash::LaunchSource source, | 81 void AppWindowLauncherItemController::Launch(ash::LaunchSource source, |
| 82 int event_flags) { | 82 int event_flags) { |
| 83 launcher_controller()->LaunchApp(app_id(), source, ui::EF_NONE); | 83 launcher_controller()->LaunchAppWithLaunchId(app_id(), launch_id(), source, |
| 84 ui::EF_NONE); | |
|
stevenjb
2016/12/09 17:00:57
LaunchApp() ?
Andra Paraschiv
2016/12/12 14:28:22
Done.
| |
| 84 } | 85 } |
| 85 | 86 |
| 86 ash::ShelfItemDelegate::PerformedAction | 87 ash::ShelfItemDelegate::PerformedAction |
| 87 AppWindowLauncherItemController::Activate(ash::LaunchSource source) { | 88 AppWindowLauncherItemController::Activate(ash::LaunchSource source) { |
| 88 DCHECK(!windows_.empty()); | 89 DCHECK(!windows_.empty()); |
| 89 ui::BaseWindow* window_to_activate = | 90 ui::BaseWindow* window_to_activate = |
| 90 last_active_window_ ? last_active_window_ : windows_.back(); | 91 last_active_window_ ? last_active_window_ : windows_.back(); |
| 91 window_to_activate->Activate(); | 92 window_to_activate->Activate(); |
| 92 return kExistingWindowActivated; | 93 return kExistingWindowActivated; |
| 93 } | 94 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 if (window_to_show->IsActive()) { | 189 if (window_to_show->IsActive()) { |
| 189 // Coming here, only a single window is active. For keyboard activations | 190 // Coming here, only a single window is active. For keyboard activations |
| 190 // the window gets animated. | 191 // the window gets animated. |
| 191 AnimateWindow(window_to_show->GetNativeWindow(), | 192 AnimateWindow(window_to_show->GetNativeWindow(), |
| 192 wm::WINDOW_ANIMATION_TYPE_BOUNCE); | 193 wm::WINDOW_ANIMATION_TYPE_BOUNCE); |
| 193 } else { | 194 } else { |
| 194 return ShowAndActivateOrMinimize(window_to_show); | 195 return ShowAndActivateOrMinimize(window_to_show); |
| 195 } | 196 } |
| 196 return kNoAction; | 197 return kNoAction; |
| 197 } | 198 } |
| OLD | NEW |