Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: ash/accelerators/accelerator_controller.cc

Issue 2961313003: Touch gestures for System Tray/ IME/ Stylus/ Notifications (Closed)
Patch Set: Fixed tdanderson's comments. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 373
374 void HandleShowMessageCenterBubble() { 374 void HandleShowMessageCenterBubble() {
375 base::RecordAction(UserMetricsAction("Accel_Show_Message_Center_Bubble")); 375 base::RecordAction(UserMetricsAction("Accel_Show_Message_Center_Bubble"));
376 aura::Window* target_root = Shell::GetRootWindowForNewWindows(); 376 aura::Window* target_root = Shell::GetRootWindowForNewWindows();
377 StatusAreaWidget* status_area_widget = 377 StatusAreaWidget* status_area_widget =
378 Shelf::ForWindow(target_root)->shelf_widget()->status_area_widget(); 378 Shelf::ForWindow(target_root)->shelf_widget()->status_area_widget();
379 if (status_area_widget) { 379 if (status_area_widget) {
380 WebNotificationTray* notification_tray = 380 WebNotificationTray* notification_tray =
381 status_area_widget->web_notification_tray(); 381 status_area_widget->web_notification_tray();
382 if (notification_tray->visible()) 382 if (notification_tray->visible())
383 notification_tray->ShowMessageCenterBubble(); 383 notification_tray->ShowBubble();
384 } 384 }
385 } 385 }
386 386
387 void HandleShowSystemTrayBubble() { 387 void HandleShowSystemTrayBubble() {
388 base::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble")); 388 base::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble"));
389 aura::Window* target_root = Shell::GetRootWindowForNewWindows(); 389 aura::Window* target_root = Shell::GetRootWindowForNewWindows();
390 SystemTray* tray = 390 SystemTray* tray =
391 RootWindowController::ForWindow(target_root)->GetSystemTray(); 391 RootWindowController::ForWindow(target_root)->GetSystemTray();
392 if (!tray->HasSystemBubble()) { 392 if (!tray->HasSystemBubble()) {
393 tray->ShowDefaultView(BUBBLE_CREATE_NEW); 393 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 } 505 }
506 506
507 void HandleShowImeMenuBubble() { 507 void HandleShowImeMenuBubble() {
508 base::RecordAction(UserMetricsAction("Accel_Show_Ime_Menu_Bubble")); 508 base::RecordAction(UserMetricsAction("Accel_Show_Ime_Menu_Bubble"));
509 509
510 StatusAreaWidget* status_area_widget = 510 StatusAreaWidget* status_area_widget =
511 Shelf::ForWindow(Shell::GetPrimaryRootWindow())->GetStatusAreaWidget(); 511 Shelf::ForWindow(Shell::GetPrimaryRootWindow())->GetStatusAreaWidget();
512 if (status_area_widget) { 512 if (status_area_widget) {
513 ImeMenuTray* ime_menu_tray = status_area_widget->ime_menu_tray(); 513 ImeMenuTray* ime_menu_tray = status_area_widget->ime_menu_tray();
514 if (ime_menu_tray && ime_menu_tray->visible() && 514 if (ime_menu_tray && ime_menu_tray->visible() &&
515 !ime_menu_tray->IsImeMenuBubbleShown()) { 515 !ime_menu_tray->GetBubbleView()) {
516 ime_menu_tray->ShowImeMenuBubble(); 516 ime_menu_tray->ShowBubble();
517 } 517 }
518 } 518 }
519 } 519 }
520 520
521 void HandleCrosh() { 521 void HandleCrosh() {
522 base::RecordAction(UserMetricsAction("Accel_Open_Crosh")); 522 base::RecordAction(UserMetricsAction("Accel_Open_Crosh"));
523 523
524 Shell::Get()->new_window_controller()->OpenCrosh(); 524 Shell::Get()->new_window_controller()->OpenCrosh();
525 } 525 }
526 526
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 void HandleLock() { 565 void HandleLock() {
566 base::RecordAction(UserMetricsAction("Accel_LockScreen_L")); 566 base::RecordAction(UserMetricsAction("Accel_LockScreen_L"));
567 Shell::Get()->session_controller()->LockScreen(); 567 Shell::Get()->session_controller()->LockScreen();
568 } 568 }
569 569
570 void HandleShowStylusTools() { 570 void HandleShowStylusTools() {
571 base::RecordAction(UserMetricsAction("Accel_Show_Stylus_Tools")); 571 base::RecordAction(UserMetricsAction("Accel_Show_Stylus_Tools"));
572 Shelf::ForWindow(Shell::GetRootWindowForNewWindows()) 572 Shelf::ForWindow(Shell::GetRootWindowForNewWindows())
573 ->GetStatusAreaWidget() 573 ->GetStatusAreaWidget()
574 ->palette_tray() 574 ->palette_tray()
575 ->ShowPalette(); 575 ->ShowBubble();
576 } 576 }
577 577
578 bool CanHandleShowStylusTools() { 578 bool CanHandleShowStylusTools() {
579 return palette_utils::ShouldShowPalette(); 579 return palette_utils::ShouldShowPalette();
580 } 580 }
581 581
582 bool CanHandleStartVoiceInteraction() { 582 bool CanHandleStartVoiceInteraction() {
583 return chromeos::switches::IsVoiceInteractionEnabled(); 583 return chromeos::switches::IsVoiceInteractionEnabled();
584 } 584 }
585 585
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 data->uma_histogram_name, data->notification_message_id, 1409 data->uma_histogram_name, data->notification_message_id,
1410 data->old_shortcut_id, data->new_shortcut_id); 1410 data->old_shortcut_id, data->new_shortcut_id);
1411 1411
1412 if (!data->deprecated_enabled) 1412 if (!data->deprecated_enabled)
1413 return AcceleratorProcessingStatus::STOP; 1413 return AcceleratorProcessingStatus::STOP;
1414 1414
1415 return AcceleratorProcessingStatus::PROCEED; 1415 return AcceleratorProcessingStatus::PROCEED;
1416 } 1416 }
1417 1417
1418 } // namespace ash 1418 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698