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

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

Issue 2603663002: Make IME extensions decide when to show the keyboard. (Closed)
Patch Set: Created 3 years, 12 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/input_method_manager_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/system/chromeos/ime_menu/ime_menu_tray.h" 5 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h"
6 6
7 #include "ash/common/accessibility_delegate.h" 7 #include "ash/common/accessibility_delegate.h"
8 #include "ash/common/ash_constants.h" 8 #include "ash/common/ash_constants.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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 // Overrides the keyboard url ref to make it shown with the given keyset. 426 // Overrides the keyboard url ref to make it shown with the given keyset.
427 if (InputMethodManager::Get()) 427 if (InputMethodManager::Get())
428 InputMethodManager::Get()->OverrideKeyboardUrlRef(keyset); 428 InputMethodManager::Get()->OverrideKeyboardUrlRef(keyset);
429 429
430 // If onscreen keyboard has been enabled, shows the keyboard directly. 430 // If onscreen keyboard has been enabled, shows the keyboard directly.
431 keyboard::KeyboardController* keyboard_controller = 431 keyboard::KeyboardController* keyboard_controller =
432 keyboard::KeyboardController::GetInstance(); 432 keyboard::KeyboardController::GetInstance();
433 show_keyboard_ = true; 433 show_keyboard_ = true;
434 if (keyboard_controller) { 434 if (keyboard_controller) {
435 keyboard_controller->AddObserver(this); 435 keyboard_controller->AddObserver(this);
436 keyboard_controller->ShowKeyboard(false); 436 // If the keyboard hasn't been loaded yet, it means it's the first time to
437 // show keyboard, OS need to trigger it. Otherwise, make IME extensions
Shu Chen 2016/12/26 02:16:39 // If the keyboard window hasn't been created yet,
Azure Wei 2016/12/26 06:53:30 Done.
438 // decide when to show the keyboard.
439 if (!keyboard_controller->KeyboardHasBeenLoaded()) {
Shu Chen 2016/12/26 02:16:39 s/KeyboardHasBeenLoaded/IsKeyboardWindowCreated/g
Azure Wei 2016/12/26 06:53:30 Done.
440 keyboard_controller->ShowKeyboard(false);
441 }
437 return; 442 return;
438 } 443 }
439 444
440 AccessibilityDelegate* accessibility_delegate = 445 AccessibilityDelegate* accessibility_delegate =
441 WmShell::Get()->accessibility_delegate(); 446 WmShell::Get()->accessibility_delegate();
442 // Fails to show the keyboard. 447 // Fails to show the keyboard.
443 if (accessibility_delegate->IsVirtualKeyboardEnabled()) 448 if (accessibility_delegate->IsVirtualKeyboardEnabled())
444 return; 449 return;
445 450
446 // Onscreen keyboard has not been enabled yet, forces to bring out the 451 // Onscreen keyboard has not been enabled yet, forces to bring out the
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 WmShell::Get()->system_tray_delegate()->GetCurrentIME(&current_ime_); 592 WmShell::Get()->system_tray_delegate()->GetCurrentIME(&current_ime_);
588 593
589 // Updates the tray label based on the current input method. 594 // Updates the tray label based on the current input method.
590 if (current_ime_.third_party) 595 if (current_ime_.third_party)
591 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*")); 596 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*"));
592 else 597 else
593 label_->SetText(current_ime_.short_name); 598 label_->SetText(current_ime_.short_name);
594 } 599 }
595 600
596 } // namespace ash 601 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/input_method_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698