OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
643 // Disable the shortcut for minimizing full screen window due to | 643 // Disable the shortcut for minimizing full screen window due to |
644 // crbug.com/131709, which is a crashing issue related to minimizing | 644 // crbug.com/131709, which is a crashing issue related to minimizing |
645 // full screen pepper window. | 645 // full screen pepper window. |
646 if (!wm::IsWindowFullscreen(window)) { | 646 if (!wm::IsWindowFullscreen(window)) { |
647 wm::MinimizeWindow(window); | 647 wm::MinimizeWindow(window); |
648 return true; | 648 return true; |
649 } | 649 } |
650 break; | 650 break; |
651 } | 651 } |
652 case WINDOW_MAXIMIZE_RESTORE: { | 652 case WINDOW_MAXIMIZE_RESTORE: { |
653 if (key_code == ui::VKEY_F4 && shell->delegate()) | |
654 shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_MAXIMIZE_RESTORE); | |
653 aura::Window* window = wm::GetActiveWindow(); | 655 aura::Window* window = wm::GetActiveWindow(); |
654 // Attempt to restore the window that would be cycled through next from | 656 // Attempt to restore the window that would be cycled through next from |
655 // the launcher when there is no active window. | 657 // the launcher when there is no active window. |
656 if (!window) | 658 if (!window) |
sky
2012/09/12 14:57:33
Is it intentional that hitting this button cycles
sschmitz
2012/09/12 23:45:50
After conferring with PM and sky@, took it out.
Do
mazda
2012/09/13 00:26:00
This is for http://crbug.com/133337.
If we've dec
sschmitz
2012/09/13 19:34:13
On further discussion PM decided to leave as is.
| |
657 return HandleCycleWindowMRU(WindowCycleController::FORWARD, false); | 659 return HandleCycleWindowMRU(WindowCycleController::FORWARD, false); |
658 if (!wm::IsWindowFullscreen(window)) { | 660 if (wm::IsWindowFullscreen(window) && shell->delegate()) |
sky
2012/09/12 14:57:33
On looking at this, why do you even need this? Doe
sschmitz
2012/09/12 23:45:50
Yes. We get out of fullscreen mode when F4 is pres
sky
2012/09/13 00:46:22
My question is, why do you need to route to the de
sschmitz
2012/09/13 19:34:13
Two Reasons for this:
1. PM changed behavior when
sky
2012/09/13 19:36:33
If that's the case, then it probably means Browser
| |
659 if (wm::IsWindowMaximized(window)) | 661 shell->delegate()->RemoveFullScreenExitBubble(); |
660 wm::RestoreWindow(window); | 662 if (wm::IsWindowFullscreen(window) || wm::IsWindowMaximized(window)) |
661 else | 663 wm::RestoreWindow(window); |
662 wm::MaximizeWindow(window); | 664 else |
663 return true; | 665 wm::MaximizeWindow(window); |
sky
2012/09/12 14:57:33
This is problematic, it assumes all windows can ma
sschmitz
2012/09/12 23:45:50
Added wm::CanMaximizeWindow(window)(thanks sadrul@
| |
664 } | 666 return true; |
665 break; | 667 break; |
666 } | 668 } |
667 case WINDOW_POSITION_CENTER: { | 669 case WINDOW_POSITION_CENTER: { |
668 aura::Window* window = wm::GetActiveWindow(); | 670 aura::Window* window = wm::GetActiveWindow(); |
669 if (window) { | 671 if (window) { |
670 wm::CenterWindow(window); | 672 wm::CenterWindow(window); |
671 return true; | 673 return true; |
672 } | 674 } |
673 break; | 675 break; |
674 } | 676 } |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
793 accelerators_.insert( | 795 accelerators_.insert( |
794 std::make_pair(accelerator, accelerators[i].action)); | 796 std::make_pair(accelerator, accelerators[i].action)); |
795 } | 797 } |
796 } | 798 } |
797 | 799 |
798 bool AcceleratorController::CanHandleAccelerators() const { | 800 bool AcceleratorController::CanHandleAccelerators() const { |
799 return true; | 801 return true; |
800 } | 802 } |
801 | 803 |
802 } // namespace ash | 804 } // namespace ash |
OLD | NEW |