| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // item if the window we are trying to activate is already active. | 131 // item if the window we are trying to activate is already active. |
| 132 if (windows_.size() >= 1 && window_to_show->IsActive() && | 132 if (windows_.size() >= 1 && window_to_show->IsActive() && |
| 133 event.type() == ui::ET_KEY_RELEASED) { | 133 event.type() == ui::ET_KEY_RELEASED) { |
| 134 return ActivateOrAdvanceToNextAppWindow(window_to_show); | 134 return ActivateOrAdvanceToNextAppWindow(window_to_show); |
| 135 } else { | 135 } else { |
| 136 return ShowAndActivateOrMinimize(window_to_show); | 136 return ShowAndActivateOrMinimize(window_to_show); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 base::string16 AppWindowLauncherItemController::GetTitle() { | 140 base::string16 AppWindowLauncherItemController::GetTitle() { |
| 141 return LauncherControllerHelper::GetAppTitle(launcher_controller()->profile(), | 141 return LauncherControllerHelper::GetAppTitle( |
| 142 app_id()); | 142 launcher_controller()->GetProfile(), app_id()); |
| 143 } | 143 } |
| 144 | 144 |
| 145 bool AppWindowLauncherItemController::IsDraggable() { | 145 bool AppWindowLauncherItemController::IsDraggable() { |
| 146 DCHECK_EQ(TYPE_APP, type()); | 146 DCHECK_EQ(TYPE_APP, type()); |
| 147 return CanPin(); | 147 return CanPin(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 bool AppWindowLauncherItemController::CanPin() const { | 150 bool AppWindowLauncherItemController::CanPin() const { |
| 151 return launcher_controller()->GetPinnable(app_id()) == | 151 return launcher_controller()->GetPinnable(app_id()) == |
| 152 AppListControllerDelegate::PIN_EDITABLE; | 152 AppListControllerDelegate::PIN_EDITABLE; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 if (window_to_show->IsActive()) { | 196 if (window_to_show->IsActive()) { |
| 197 // Coming here, only a single window is active. For keyboard activations | 197 // Coming here, only a single window is active. For keyboard activations |
| 198 // the window gets animated. | 198 // the window gets animated. |
| 199 AnimateWindow(window_to_show->GetNativeWindow(), | 199 AnimateWindow(window_to_show->GetNativeWindow(), |
| 200 wm::WINDOW_ANIMATION_TYPE_BOUNCE); | 200 wm::WINDOW_ANIMATION_TYPE_BOUNCE); |
| 201 } else { | 201 } else { |
| 202 return ShowAndActivateOrMinimize(window_to_show); | 202 return ShowAndActivateOrMinimize(window_to_show); |
| 203 } | 203 } |
| 204 return kNoAction; | 204 return kNoAction; |
| 205 } | 205 } |
| OLD | NEW |