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 "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
12 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" | 12 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" |
13 #include "ui/aura/client/aura_constants.h" | 13 #include "ui/aura/client/aura_constants.h" |
14 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
15 #include "ui/base/base_window.h" | 15 #include "ui/base/base_window.h" |
16 #include "ui/wm/core/window_animations.h" | 16 #include "ui/wm/core/window_animations.h" |
17 | 17 |
18 AppWindowLauncherItemController::AppWindowLauncherItemController( | 18 AppWindowLauncherItemController::AppWindowLauncherItemController( |
19 const ash::AppLaunchId& app_launch_id) | 19 const ash::ShelfID& shelf_id) |
20 : ash::ShelfItemDelegate(app_launch_id), observed_windows_(this) {} | 20 : ash::ShelfItemDelegate(shelf_id), observed_windows_(this) {} |
21 | 21 |
22 AppWindowLauncherItemController::~AppWindowLauncherItemController() {} | 22 AppWindowLauncherItemController::~AppWindowLauncherItemController() {} |
23 | 23 |
24 void AppWindowLauncherItemController::AddWindow(ui::BaseWindow* app_window) { | 24 void AppWindowLauncherItemController::AddWindow(ui::BaseWindow* app_window) { |
25 windows_.push_front(app_window); | 25 windows_.push_front(app_window); |
26 aura::Window* window = app_window->GetNativeWindow(); | 26 aura::Window* window = app_window->GetNativeWindow(); |
27 if (window) | 27 if (window) |
28 observed_windows_.Add(window); | 28 observed_windows_.Add(window); |
29 } | 29 } |
30 | 30 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 if (window_to_show->IsActive()) { | 155 if (window_to_show->IsActive()) { |
156 // Coming here, only a single window is active. For keyboard activations | 156 // Coming here, only a single window is active. For keyboard activations |
157 // the window gets animated. | 157 // the window gets animated. |
158 AnimateWindow(window_to_show->GetNativeWindow(), | 158 AnimateWindow(window_to_show->GetNativeWindow(), |
159 wm::WINDOW_ANIMATION_TYPE_BOUNCE); | 159 wm::WINDOW_ANIMATION_TYPE_BOUNCE); |
160 } else { | 160 } else { |
161 return ShowAndActivateOrMinimize(window_to_show); | 161 return ShowAndActivateOrMinimize(window_to_show); |
162 } | 162 } |
163 return ash::SHELF_ACTION_NONE; | 163 return ash::SHELF_ACTION_NONE; |
164 } | 164 } |
OLD | NEW |