| 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/common/system/tray/system_tray.h" | 5 #include "ash/common/system/tray/system_tray.h" |
| 6 | 6 |
| 7 #include "ash/common/key_event_watcher.h" | 7 #include "ash/common/key_event_watcher.h" |
| 8 #include "ash/common/login_status.h" | 8 #include "ash/common/login_status.h" |
| 9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 void SystemTray::ActivateAndStartNavigation(const ui::KeyEvent& key_event) { | 792 void SystemTray::ActivateAndStartNavigation(const ui::KeyEvent& key_event) { |
| 793 if (!system_bubble_) | 793 if (!system_bubble_) |
| 794 return; | 794 return; |
| 795 ActivateBubble(); | 795 ActivateBubble(); |
| 796 views::Widget* widget = GetSystemBubble()->bubble_view()->GetWidget(); | 796 views::Widget* widget = GetSystemBubble()->bubble_view()->GetWidget(); |
| 797 widget->GetFocusManager()->OnKeyEvent(key_event); | 797 widget->GetFocusManager()->OnKeyEvent(key_event); |
| 798 } | 798 } |
| 799 | 799 |
| 800 void SystemTray::CreateKeyEventWatcher() { | 800 void SystemTray::CreateKeyEventWatcher() { |
| 801 key_event_watcher_ = WmShell::Get()->CreateKeyEventWatcher(); | 801 key_event_watcher_ = WmShell::Get()->CreateKeyEventWatcher(); |
| 802 // mustash does not yet support KeyEventWatcher. http://crbug.com/649600. |
| 803 if (!key_event_watcher_) |
| 804 return; |
| 802 key_event_watcher_->AddKeyEventCallback( | 805 key_event_watcher_->AddKeyEventCallback( |
| 803 ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE), | 806 ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE), |
| 804 base::Bind(&SystemTray::CloseBubble, base::Unretained(this))); | 807 base::Bind(&SystemTray::CloseBubble, base::Unretained(this))); |
| 805 key_event_watcher_->AddKeyEventCallback( | 808 key_event_watcher_->AddKeyEventCallback( |
| 806 ui::Accelerator(ui::VKEY_TAB, ui::EF_NONE), | 809 ui::Accelerator(ui::VKEY_TAB, ui::EF_NONE), |
| 807 base::Bind(&SystemTray::ActivateAndStartNavigation, | 810 base::Bind(&SystemTray::ActivateAndStartNavigation, |
| 808 base::Unretained(this))); | 811 base::Unretained(this))); |
| 809 key_event_watcher_->AddKeyEventCallback( | 812 key_event_watcher_->AddKeyEventCallback( |
| 810 ui::Accelerator(ui::VKEY_TAB, ui::EF_SHIFT_DOWN), | 813 ui::Accelerator(ui::VKEY_TAB, ui::EF_SHIFT_DOWN), |
| 811 base::Bind(&SystemTray::ActivateAndStartNavigation, | 814 base::Bind(&SystemTray::ActivateAndStartNavigation, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 .work_area() | 877 .work_area() |
| 875 .height(); | 878 .height(); |
| 876 if (work_area_height > 0) { | 879 if (work_area_height > 0) { |
| 877 UMA_HISTOGRAM_CUSTOM_COUNTS( | 880 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 878 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 881 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
| 879 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 882 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
| 880 } | 883 } |
| 881 } | 884 } |
| 882 | 885 |
| 883 } // namespace ash | 886 } // namespace ash |
| OLD | NEW |