| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/accelerators/accelerator_commands.h" | 9 #include "ash/accelerators/accelerator_commands.h" |
| 10 #include "ash/accelerators/accelerator_controller_delegate.h" | 10 #include "ash/accelerators/accelerator_controller_delegate.h" |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 332 |
| 333 void HandleShowMessageCenterBubble() { | 333 void HandleShowMessageCenterBubble() { |
| 334 base::RecordAction(UserMetricsAction("Accel_Show_Message_Center_Bubble")); | 334 base::RecordAction(UserMetricsAction("Accel_Show_Message_Center_Bubble")); |
| 335 aura::Window* target_root = Shell::GetRootWindowForNewWindows(); | 335 aura::Window* target_root = Shell::GetRootWindowForNewWindows(); |
| 336 StatusAreaWidget* status_area_widget = | 336 StatusAreaWidget* status_area_widget = |
| 337 Shelf::ForWindow(target_root)->shelf_widget()->status_area_widget(); | 337 Shelf::ForWindow(target_root)->shelf_widget()->status_area_widget(); |
| 338 if (status_area_widget) { | 338 if (status_area_widget) { |
| 339 WebNotificationTray* notification_tray = | 339 WebNotificationTray* notification_tray = |
| 340 status_area_widget->web_notification_tray(); | 340 status_area_widget->web_notification_tray(); |
| 341 if (notification_tray->visible()) | 341 if (notification_tray->visible()) |
| 342 notification_tray->ShowMessageCenterBubble(); | 342 notification_tray->ShowBubble(); |
| 343 } | 343 } |
| 344 } | 344 } |
| 345 | 345 |
| 346 void HandleShowSystemTrayBubble() { | 346 void HandleShowSystemTrayBubble() { |
| 347 base::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble")); | 347 base::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble")); |
| 348 aura::Window* target_root = Shell::GetRootWindowForNewWindows(); | 348 aura::Window* target_root = Shell::GetRootWindowForNewWindows(); |
| 349 SystemTray* tray = | 349 SystemTray* tray = |
| 350 RootWindowController::ForWindow(target_root)->GetSystemTray(); | 350 RootWindowController::ForWindow(target_root)->GetSystemTray(); |
| 351 if (!tray->HasSystemBubble()) { | 351 if (!tray->HasSystemBubble()) { |
| 352 tray->ShowDefaultView(BUBBLE_CREATE_NEW); | 352 tray->ShowDefaultView(BUBBLE_CREATE_NEW); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 } | 449 } |
| 450 | 450 |
| 451 void HandleShowImeMenuBubble() { | 451 void HandleShowImeMenuBubble() { |
| 452 base::RecordAction(UserMetricsAction("Accel_Show_Ime_Menu_Bubble")); | 452 base::RecordAction(UserMetricsAction("Accel_Show_Ime_Menu_Bubble")); |
| 453 | 453 |
| 454 StatusAreaWidget* status_area_widget = | 454 StatusAreaWidget* status_area_widget = |
| 455 Shelf::ForWindow(Shell::GetPrimaryRootWindow())->GetStatusAreaWidget(); | 455 Shelf::ForWindow(Shell::GetPrimaryRootWindow())->GetStatusAreaWidget(); |
| 456 if (status_area_widget) { | 456 if (status_area_widget) { |
| 457 ImeMenuTray* ime_menu_tray = status_area_widget->ime_menu_tray(); | 457 ImeMenuTray* ime_menu_tray = status_area_widget->ime_menu_tray(); |
| 458 if (ime_menu_tray && ime_menu_tray->visible() && | 458 if (ime_menu_tray && ime_menu_tray->visible() && |
| 459 !ime_menu_tray->IsImeMenuBubbleShown()) { | 459 !ime_menu_tray->GetBubbleView()) { |
| 460 ime_menu_tray->ShowImeMenuBubble(); | 460 ime_menu_tray->ShowBubble(); |
| 461 } | 461 } |
| 462 } | 462 } |
| 463 } | 463 } |
| 464 | 464 |
| 465 void HandleCrosh() { | 465 void HandleCrosh() { |
| 466 base::RecordAction(UserMetricsAction("Accel_Open_Crosh")); | 466 base::RecordAction(UserMetricsAction("Accel_Open_Crosh")); |
| 467 | 467 |
| 468 Shell::Get()->new_window_controller()->OpenCrosh(); | 468 Shell::Get()->new_window_controller()->OpenCrosh(); |
| 469 } | 469 } |
| 470 | 470 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 void HandleLock() { | 509 void HandleLock() { |
| 510 base::RecordAction(UserMetricsAction("Accel_LockScreen_L")); | 510 base::RecordAction(UserMetricsAction("Accel_LockScreen_L")); |
| 511 Shell::Get()->session_controller()->LockScreen(); | 511 Shell::Get()->session_controller()->LockScreen(); |
| 512 } | 512 } |
| 513 | 513 |
| 514 void HandleShowStylusTools() { | 514 void HandleShowStylusTools() { |
| 515 base::RecordAction(UserMetricsAction("Accel_Show_Stylus_Tools")); | 515 base::RecordAction(UserMetricsAction("Accel_Show_Stylus_Tools")); |
| 516 Shelf::ForWindow(Shell::GetRootWindowForNewWindows()) | 516 Shelf::ForWindow(Shell::GetRootWindowForNewWindows()) |
| 517 ->GetStatusAreaWidget() | 517 ->GetStatusAreaWidget() |
| 518 ->palette_tray() | 518 ->palette_tray() |
| 519 ->ShowPalette(); | 519 ->ShowBubble(); |
| 520 } | 520 } |
| 521 | 521 |
| 522 bool CanHandleShowStylusTools() { | 522 bool CanHandleShowStylusTools() { |
| 523 return palette_utils::ShouldShowPalette(); | 523 return palette_utils::ShouldShowPalette(); |
| 524 } | 524 } |
| 525 | 525 |
| 526 bool CanHandleStartVoiceInteraction() { | 526 bool CanHandleStartVoiceInteraction() { |
| 527 return chromeos::switches::IsVoiceInteractionEnabled(); | 527 return chromeos::switches::IsVoiceInteractionEnabled(); |
| 528 } | 528 } |
| 529 | 529 |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 data->uma_histogram_name, data->notification_message_id, | 1318 data->uma_histogram_name, data->notification_message_id, |
| 1319 data->old_shortcut_id, data->new_shortcut_id); | 1319 data->old_shortcut_id, data->new_shortcut_id); |
| 1320 | 1320 |
| 1321 if (!data->deprecated_enabled) | 1321 if (!data->deprecated_enabled) |
| 1322 return AcceleratorProcessingStatus::STOP; | 1322 return AcceleratorProcessingStatus::STOP; |
| 1323 | 1323 |
| 1324 return AcceleratorProcessingStatus::PROCEED; | 1324 return AcceleratorProcessingStatus::PROCEED; |
| 1325 } | 1325 } |
| 1326 | 1326 |
| 1327 } // namespace ash | 1327 } // namespace ash |
| OLD | NEW |