OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/accelerators/accelerator_controller_delegate_aura.h" | 5 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 } | 216 } |
217 | 217 |
218 void HandleTakeScreenshot(ScreenshotDelegate* screenshot_delegate) { | 218 void HandleTakeScreenshot(ScreenshotDelegate* screenshot_delegate) { |
219 base::RecordAction(UserMetricsAction("Accel_Take_Screenshot")); | 219 base::RecordAction(UserMetricsAction("Accel_Take_Screenshot")); |
220 DCHECK(screenshot_delegate); | 220 DCHECK(screenshot_delegate); |
221 if (screenshot_delegate->CanTakeScreenshot()) | 221 if (screenshot_delegate->CanTakeScreenshot()) |
222 screenshot_delegate->HandleTakeScreenshotForAllRootWindows(); | 222 screenshot_delegate->HandleTakeScreenshotForAllRootWindows(); |
223 } | 223 } |
224 | 224 |
225 bool CanHandleUnpin() { | 225 bool CanHandleUnpin() { |
| 226 // Returns true only for WINDOW_STATE_TYPE_PINNED. |
| 227 // WINDOW_STATE_TYPE_TRUSTED_PINNED does not accept user's unpin operation. |
226 wm::WindowState* window_state = wm::GetActiveWindowState(); | 228 wm::WindowState* window_state = wm::GetActiveWindowState(); |
227 return window_state && window_state->IsPinned(); | 229 return window_state && |
| 230 window_state->GetStateType() == wm::WINDOW_STATE_TYPE_PINNED; |
228 } | 231 } |
229 | 232 |
230 #if defined(OS_CHROMEOS) | 233 #if defined(OS_CHROMEOS) |
231 void HandleSwapPrimaryDisplay() { | 234 void HandleSwapPrimaryDisplay() { |
232 base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display")); | 235 base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display")); |
233 Shell::GetInstance()->display_configuration_controller()->SetPrimaryDisplayId( | 236 Shell::GetInstance()->display_configuration_controller()->SetPrimaryDisplayId( |
234 ScreenUtil::GetSecondaryDisplay().id(), true /* user_action */); | 237 ScreenUtil::GetSecondaryDisplay().id(), true /* user_action */); |
235 } | 238 } |
236 | 239 |
237 void HandleToggleMirrorMode() { | 240 void HandleToggleMirrorMode() { |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 message_center::NotifierId( | 499 message_center::NotifierId( |
497 message_center::NotifierId::SYSTEM_COMPONENT, | 500 message_center::NotifierId::SYSTEM_COMPONENT, |
498 system_notifier::kNotifierDeprecatedAccelerator), | 501 system_notifier::kNotifierDeprecatedAccelerator), |
499 message_center::RichNotificationData(), | 502 message_center::RichNotificationData(), |
500 new DeprecatedAcceleratorNotificationDelegate)); | 503 new DeprecatedAcceleratorNotificationDelegate)); |
501 message_center::MessageCenter::Get()->AddNotification( | 504 message_center::MessageCenter::Get()->AddNotification( |
502 std::move(notification)); | 505 std::move(notification)); |
503 } | 506 } |
504 | 507 |
505 } // namespace ash | 508 } // namespace ash |
OLD | NEW |