| 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" |
| 11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h" | 11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.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 Type type, | 19 Type type, |
| 20 const std::string& app_shelf_id, | |
| 21 const std::string& app_id, | 20 const std::string& app_id, |
| 21 const std::string& launch_id, |
| 22 ChromeLauncherController* controller) | 22 ChromeLauncherController* controller) |
| 23 : LauncherItemController(type, app_id, controller), | 23 : LauncherItemController(type, app_id, launch_id, controller), |
| 24 app_shelf_id_(app_shelf_id), | 24 app_id_(app_id), |
| 25 launch_id_(launch_id), |
| 25 observed_windows_(this) {} | 26 observed_windows_(this) {} |
| 26 | 27 |
| 27 AppWindowLauncherItemController::~AppWindowLauncherItemController() {} | 28 AppWindowLauncherItemController::~AppWindowLauncherItemController() {} |
| 28 | 29 |
| 29 void AppWindowLauncherItemController::AddWindow(ui::BaseWindow* app_window) { | 30 void AppWindowLauncherItemController::AddWindow(ui::BaseWindow* app_window) { |
| 30 windows_.push_front(app_window); | 31 windows_.push_front(app_window); |
| 31 aura::Window* window = app_window->GetNativeWindow(); | 32 aura::Window* window = app_window->GetNativeWindow(); |
| 32 if (window) | 33 if (window) |
| 33 observed_windows_.Add(window); | 34 observed_windows_.Add(window); |
| 34 } | 35 } |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 if (window_to_show->IsActive()) { | 198 if (window_to_show->IsActive()) { |
| 198 // Coming here, only a single window is active. For keyboard activations | 199 // Coming here, only a single window is active. For keyboard activations |
| 199 // the window gets animated. | 200 // the window gets animated. |
| 200 AnimateWindow(window_to_show->GetNativeWindow(), | 201 AnimateWindow(window_to_show->GetNativeWindow(), |
| 201 wm::WINDOW_ANIMATION_TYPE_BOUNCE); | 202 wm::WINDOW_ANIMATION_TYPE_BOUNCE); |
| 202 } else { | 203 } else { |
| 203 return ShowAndActivateOrMinimize(window_to_show); | 204 return ShowAndActivateOrMinimize(window_to_show); |
| 204 } | 205 } |
| 205 return kNoAction; | 206 return kNoAction; |
| 206 } | 207 } |
| OLD | NEW |