| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } else { | 129 } else { |
| 130 return ShowAndActivateOrMinimize(window_to_show); | 130 return ShowAndActivateOrMinimize(window_to_show); |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 base::string16 AppWindowLauncherItemController::GetTitle() { | 134 base::string16 AppWindowLauncherItemController::GetTitle() { |
| 135 return LauncherControllerHelper::GetAppTitle(launcher_controller()->profile(), | 135 return LauncherControllerHelper::GetAppTitle(launcher_controller()->profile(), |
| 136 app_id()); | 136 app_id()); |
| 137 } | 137 } |
| 138 | 138 |
| 139 bool AppWindowLauncherItemController::IsDraggable() { | |
| 140 return true; | |
| 141 } | |
| 142 | |
| 143 bool AppWindowLauncherItemController::CanPin() const { | 139 bool AppWindowLauncherItemController::CanPin() const { |
| 144 return GetPinnableForAppID(app_id(), launcher_controller()->profile()) == | 140 return GetPinnableForAppID(app_id(), launcher_controller()->profile()) == |
| 145 AppListControllerDelegate::PIN_EDITABLE; | 141 AppListControllerDelegate::PIN_EDITABLE; |
| 146 } | 142 } |
| 147 | 143 |
| 148 void AppWindowLauncherItemController::OnWindowPropertyChanged( | 144 void AppWindowLauncherItemController::OnWindowPropertyChanged( |
| 149 aura::Window* window, | 145 aura::Window* window, |
| 150 const void* key, | 146 const void* key, |
| 151 intptr_t old) { | 147 intptr_t old) { |
| 152 if (key == aura::client::kDrawAttentionKey) { | 148 if (key == aura::client::kDrawAttentionKey) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 if (window_to_show->IsActive()) { | 180 if (window_to_show->IsActive()) { |
| 185 // Coming here, only a single window is active. For keyboard activations | 181 // Coming here, only a single window is active. For keyboard activations |
| 186 // the window gets animated. | 182 // the window gets animated. |
| 187 AnimateWindow(window_to_show->GetNativeWindow(), | 183 AnimateWindow(window_to_show->GetNativeWindow(), |
| 188 wm::WINDOW_ANIMATION_TYPE_BOUNCE); | 184 wm::WINDOW_ANIMATION_TYPE_BOUNCE); |
| 189 } else { | 185 } else { |
| 190 return ShowAndActivateOrMinimize(window_to_show); | 186 return ShowAndActivateOrMinimize(window_to_show); |
| 191 } | 187 } |
| 192 return kNoAction; | 188 return kNoAction; |
| 193 } | 189 } |
| OLD | NEW |