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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 wallpaper::WALLPAPER_LAYOUT_CENTER); | 306 wallpaper::WALLPAPER_LAYOUT_CENTER); |
307 break; | 307 break; |
308 case 3: | 308 case 3: |
309 desktop_background_controller->SetWallpaperImage( | 309 desktop_background_controller->SetWallpaperImage( |
310 CreateWallpaperImage(SK_ColorGREEN, SK_ColorRED), | 310 CreateWallpaperImage(SK_ColorGREEN, SK_ColorRED), |
311 wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED); | 311 wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED); |
312 break; | 312 break; |
313 } | 313 } |
314 } | 314 } |
315 | 315 |
316 bool CanHandleUnpin() { | 316 bool CanHandleUnpin() { |
hidehiko
2016/08/29 14:31:38
Looks to work practically, but is it ok to leave U
hirono
2016/08/30 07:16:08
I tried to create a new list in accelerator_table.
| |
317 // Returns true only for WINDOW_STATE_TYPE_PINNED. | |
318 // WINDOW_STATE_TYPE_TRUSTED_PINNED does not accept user's unpin operation. | |
317 wm::WindowState* window_state = wm::GetActiveWindowState(); | 319 wm::WindowState* window_state = wm::GetActiveWindowState(); |
318 return window_state && window_state->IsPinned(); | 320 return window_state && |
321 window_state->GetStateType() == wm::WINDOW_STATE_TYPE_PINNED; | |
319 } | 322 } |
320 | 323 |
321 #if defined(OS_CHROMEOS) | 324 #if defined(OS_CHROMEOS) |
322 void HandleSwapPrimaryDisplay() { | 325 void HandleSwapPrimaryDisplay() { |
323 base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display")); | 326 base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display")); |
324 Shell::GetInstance()->display_configuration_controller()->SetPrimaryDisplayId( | 327 Shell::GetInstance()->display_configuration_controller()->SetPrimaryDisplayId( |
325 ScreenUtil::GetSecondaryDisplay().id(), true /* user_action */); | 328 ScreenUtil::GetSecondaryDisplay().id(), true /* user_action */); |
326 } | 329 } |
327 | 330 |
328 void HandleToggleMirrorMode() { | 331 void HandleToggleMirrorMode() { |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
644 message_center::NotifierId( | 647 message_center::NotifierId( |
645 message_center::NotifierId::SYSTEM_COMPONENT, | 648 message_center::NotifierId::SYSTEM_COMPONENT, |
646 system_notifier::kNotifierDeprecatedAccelerator), | 649 system_notifier::kNotifierDeprecatedAccelerator), |
647 message_center::RichNotificationData(), | 650 message_center::RichNotificationData(), |
648 new DeprecatedAcceleratorNotificationDelegate)); | 651 new DeprecatedAcceleratorNotificationDelegate)); |
649 message_center::MessageCenter::Get()->AddNotification( | 652 message_center::MessageCenter::Get()->AddNotification( |
650 std::move(notification)); | 653 std::move(notification)); |
651 } | 654 } |
652 | 655 |
653 } // namespace ash | 656 } // namespace ash |
OLD | NEW |