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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 base::string16 AppWindowLauncherItemController::GetTitle() { | 139 base::string16 AppWindowLauncherItemController::GetTitle() { |
140 return GetAppTitle(); | 140 return GetAppTitle(); |
141 } | 141 } |
142 | 142 |
143 bool AppWindowLauncherItemController::IsDraggable() { | 143 bool AppWindowLauncherItemController::IsDraggable() { |
144 DCHECK_EQ(TYPE_APP, type()); | 144 DCHECK_EQ(TYPE_APP, type()); |
145 return CanPin(); | 145 return CanPin(); |
146 } | 146 } |
147 | 147 |
148 bool AppWindowLauncherItemController::CanPin() const { | 148 bool AppWindowLauncherItemController::CanPin() const { |
149 return launcher_controller()->CanPin(app_id()); | 149 return launcher_controller()->GetPinnable(app_id()) == |
| 150 AppListControllerDelegate::PIN_EDITABLE; |
150 } | 151 } |
151 | 152 |
152 bool AppWindowLauncherItemController::ShouldShowTooltip() { | 153 bool AppWindowLauncherItemController::ShouldShowTooltip() { |
153 DCHECK_EQ(TYPE_APP, type()); | 154 DCHECK_EQ(TYPE_APP, type()); |
154 return true; | 155 return true; |
155 } | 156 } |
156 | 157 |
157 void AppWindowLauncherItemController::OnWindowPropertyChanged( | 158 void AppWindowLauncherItemController::OnWindowPropertyChanged( |
158 aura::Window* window, | 159 aura::Window* window, |
159 const void* key, | 160 const void* key, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 if (window_to_show->IsActive()) { | 194 if (window_to_show->IsActive()) { |
194 // Coming here, only a single window is active. For keyboard activations | 195 // Coming here, only a single window is active. For keyboard activations |
195 // the window gets animated. | 196 // the window gets animated. |
196 AnimateWindow(window_to_show->GetNativeWindow(), | 197 AnimateWindow(window_to_show->GetNativeWindow(), |
197 wm::WINDOW_ANIMATION_TYPE_BOUNCE); | 198 wm::WINDOW_ANIMATION_TYPE_BOUNCE); |
198 } else { | 199 } else { |
199 return ShowAndActivateOrMinimize(window_to_show); | 200 return ShowAndActivateOrMinimize(window_to_show); |
200 } | 201 } |
201 return kNoAction; | 202 return kNoAction; |
202 } | 203 } |
OLD | NEW |