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

Side by Side Diff: ash/system/ime_menu/ime_menu_tray.cc

Issue 2961313003: Touch gestures for System Tray/ IME/ Stylus/ Notifications (Closed)
Patch Set: Swiping IME/Stylues/System tray/Notifications tray/bubble. 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 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/system/ime_menu/ime_menu_tray.h" 5 #include "ash/system/ime_menu/ime_menu_tray.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accessibility_delegate.h" 8 #include "ash/accessibility_delegate.h"
9 #include "ash/ash_constants.h" 9 #include "ash/ash_constants.h"
10 #include "ash/ime/ime_controller.h" 10 #include "ash/ime/ime_controller.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 } 463 }
464 464
465 bool ImeMenuTray::PerformAction(const ui::Event& event) { 465 bool ImeMenuTray::PerformAction(const ui::Event& event) {
466 if (bubble_) 466 if (bubble_)
467 HideImeMenuBubble(); 467 HideImeMenuBubble();
468 else 468 else
469 ShowImeMenuBubble(); 469 ShowImeMenuBubble();
470 return true; 470 return true;
471 } 471 }
472 472
473 bool ImeMenuTray::HasBubble() {
474 return bubble_.get() != NULL;
msw 2017/07/12 05:04:50 nit: this should be moot, but use nullptr instead
minch1 2017/07/13 19:10:34 Done.
475 }
476
477 void ImeMenuTray::CloseBubble() {
478 HideImeMenuBubble();
479 }
480
481 void ImeMenuTray::ShowBubble() {
482 ShowImeMenuBubble();
483 }
484
485 views::TrayBubbleView* ImeMenuTray::GetBubbleView() {
486 if (HasBubble())
msw 2017/07/12 05:04:50 nit: return bubble_ ? bubble_->bubble_view() : nul
minch1 2017/07/13 19:10:34 Done.
487 return bubble_->bubble_view();
488 return nullptr;
489 }
490
491 void ImeMenuTray::OnGestureEvent(ui::GestureEvent* event) {
492 if (drag_controller()->ProcessGestureEvent(*event, this,
493 false /* is_on_bubble */)) {
494 event->SetHandled();
msw 2017/07/12 05:04:50 Please make DragController::ProcessGestureEvent ta
minch1 2017/07/13 19:10:34 Done.
495 } else {
496 TrayBackgroundView::OnGestureEvent(event);
497 }
498 }
499
473 void ImeMenuTray::OnIMERefresh() { 500 void ImeMenuTray::OnIMERefresh() {
474 UpdateTrayLabel(); 501 UpdateTrayLabel();
475 if (bubble_ && ime_list_view_) { 502 if (bubble_ && ime_list_view_) {
476 ime_list_view_->Update(ime_controller_->current_ime().id, 503 ime_list_view_->Update(ime_controller_->current_ime().id,
477 ime_controller_->available_imes(), 504 ime_controller_->available_imes(),
478 ime_controller_->current_ime_menu_items(), false, 505 ime_controller_->current_ime_menu_items(), false,
479 ImeListView::SHOW_SINGLE_IME); 506 ImeListView::SHOW_SINGLE_IME);
480 } 507 }
481 } 508 }
482 509
(...skipping 29 matching lines...) Expand all
512 } 539 }
513 540
514 bool ImeMenuTray::ShouldEnableExtraKeyboardAccessibility() { 541 bool ImeMenuTray::ShouldEnableExtraKeyboardAccessibility() {
515 return Shell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled(); 542 return Shell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled();
516 } 543 }
517 544
518 void ImeMenuTray::HideBubble(const views::TrayBubbleView* bubble_view) { 545 void ImeMenuTray::HideBubble(const views::TrayBubbleView* bubble_view) {
519 HideBubbleWithView(bubble_view); 546 HideBubbleWithView(bubble_view);
520 } 547 }
521 548
549 bool ImeMenuTray::ProcessGestureEventForBubble(ui::GestureEvent* event) {
550 return drag_controller()->ProcessGestureEvent(*event, this,
551 true /* is_on_bubble */);
552 }
522 void ImeMenuTray::OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) {} 553 void ImeMenuTray::OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) {}
523 554
524 void ImeMenuTray::OnKeyboardClosed() { 555 void ImeMenuTray::OnKeyboardClosed() {
525 if (InputMethodManager::Get()) 556 if (InputMethodManager::Get())
526 InputMethodManager::Get()->OverrideKeyboardUrlRef(std::string()); 557 InputMethodManager::Get()->OverrideKeyboardUrlRef(std::string());
527 keyboard::KeyboardController* keyboard_controller = 558 keyboard::KeyboardController* keyboard_controller =
528 keyboard::KeyboardController::GetInstance(); 559 keyboard::KeyboardController::GetInstance();
529 if (keyboard_controller) 560 if (keyboard_controller)
530 keyboard_controller->RemoveObserver(this); 561 keyboard_controller->RemoveObserver(this);
531 562
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 else 616 else
586 label_->SetText(current_ime.short_name); 617 label_->SetText(current_ime.short_name);
587 } 618 }
588 619
589 void ImeMenuTray::DisableVirtualKeyboard() { 620 void ImeMenuTray::DisableVirtualKeyboard() {
590 Shell::Get()->accessibility_delegate()->SetVirtualKeyboardEnabled(false); 621 Shell::Get()->accessibility_delegate()->SetVirtualKeyboardEnabled(false);
591 force_show_keyboard_ = false; 622 force_show_keyboard_ = false;
592 } 623 }
593 624
594 } // namespace ash 625 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698