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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_engine.cc

Issue 219503003: Make keyboard controller a singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix root window controller unittets. Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chromeos/input_method/input_method_engine.h" 5 #include "chrome/browser/chromeos/input_method/input_method_engine.h"
6 6
7 #define XK_MISCELLANY 7 #define XK_MISCELLANY
8 #include <X11/keysymdef.h> 8 #include <X11/keysymdef.h>
9 #include <X11/X.h> 9 #include <X11/X.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 IMEInputContextHandlerInterface* input_context = 428 IMEInputContextHandlerInterface* input_context =
429 IMEBridge::Get()->GetInputContextHandler(); 429 IMEBridge::Get()->GetInputContextHandler();
430 if (input_context) 430 if (input_context)
431 input_context->DeleteSurroundingText(offset, number_of_chars); 431 input_context->DeleteSurroundingText(offset, number_of_chars);
432 432
433 return true; 433 return true;
434 } 434 }
435 435
436 void InputMethodEngine::HideInputView() { 436 void InputMethodEngine::HideInputView() {
437 keyboard::KeyboardController* keyboard_controller = 437 keyboard::KeyboardController* keyboard_controller =
438 ash::Shell::GetInstance()->keyboard_controller(); 438 keyboard::KeyboardController::GetInstance();
439 if (keyboard_controller) { 439 if (keyboard_controller) {
440 keyboard_controller->HideKeyboard( 440 keyboard_controller->HideKeyboard(
441 keyboard::KeyboardController::HIDE_REASON_MANUAL); 441 keyboard::KeyboardController::HIDE_REASON_MANUAL);
442 } 442 }
443 } 443 }
444 444
445 void InputMethodEngine::FocusIn( 445 void InputMethodEngine::FocusIn(
446 const IMEEngineHandlerInterface::InputContext& input_context) { 446 const IMEEngineHandlerInterface::InputContext& input_context) {
447 focused_ = true; 447 focused_ = true;
448 if (!active_) 448 if (!active_)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 487
488 void InputMethodEngine::Enable() { 488 void InputMethodEngine::Enable() {
489 active_ = true; 489 active_ = true;
490 observer_->OnActivate(engine_id_); 490 observer_->OnActivate(engine_id_);
491 IMEEngineHandlerInterface::InputContext context(ui::TEXT_INPUT_TYPE_TEXT, 491 IMEEngineHandlerInterface::InputContext context(ui::TEXT_INPUT_TYPE_TEXT,
492 ui::TEXT_INPUT_MODE_DEFAULT); 492 ui::TEXT_INPUT_MODE_DEFAULT);
493 FocusIn(context); 493 FocusIn(context);
494 494
495 keyboard::SetOverrideContentUrl(input_view_url_); 495 keyboard::SetOverrideContentUrl(input_view_url_);
496 keyboard::KeyboardController* keyboard_controller = 496 keyboard::KeyboardController* keyboard_controller =
497 ash::Shell::GetInstance()->keyboard_controller(); 497 keyboard::KeyboardController::GetInstance();
498 if (keyboard_controller) 498 if (keyboard_controller)
499 keyboard_controller->Reload(); 499 keyboard_controller->Reload();
500 } 500 }
501 501
502 void InputMethodEngine::Disable() { 502 void InputMethodEngine::Disable() {
503 active_ = false; 503 active_ = false;
504 observer_->OnDeactivated(engine_id_); 504 observer_->OnDeactivated(engine_id_);
505 505
506 GURL empty_url; 506 GURL empty_url;
507 keyboard::SetOverrideContentUrl(empty_url); 507 keyboard::SetOverrideContentUrl(empty_url);
508 keyboard::KeyboardController* keyboard_controller = 508 keyboard::KeyboardController* keyboard_controller =
509 ash::Shell::GetInstance()->keyboard_controller(); 509 keyboard::KeyboardController::GetInstance();
510 if (keyboard_controller) 510 if (keyboard_controller)
511 keyboard_controller->Reload(); 511 keyboard_controller->Reload();
512 } 512 }
513 513
514 void InputMethodEngine::PropertyActivate(const std::string& property_name) { 514 void InputMethodEngine::PropertyActivate(const std::string& property_name) {
515 observer_->OnMenuItemActivated(engine_id_, property_name); 515 observer_->OnMenuItemActivated(engine_id_, property_name);
516 } 516 }
517 517
518 void InputMethodEngine::Reset() { 518 void InputMethodEngine::Reset() {
519 observer_->OnReset(engine_id_); 519 observer_->OnReset(engine_id_);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 // TODO(nona): Implement it. 635 // TODO(nona): Implement it.
636 break; 636 break;
637 } 637 }
638 } 638 }
639 } 639 }
640 640
641 // TODO(nona): Support item.children. 641 // TODO(nona): Support item.children.
642 } 642 }
643 643
644 } // namespace chromeos 644 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698