| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 11 #include "chrome/browser/chromeos/input_method/ibus_engine_controller.h" | 11 #include "chrome/browser/chromeos/input_method/ibus_engine_controller.h" |
| 12 #include "chrome/browser/chromeos/input_method/ibus_keymap.h" | 12 #include "chrome/browser/chromeos/input_method/ibus_keymap.h" |
| 13 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 13 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 14 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 14 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 15 | 15 |
| 16 namespace chromeos { | 16 namespace chromeos { |
| 17 | 17 |
| 18 const char* kExtensionImePrefix = "_ext_ime_"; | 18 const char* kExtensionImePrefix = "_ext_ime_"; |
| 19 const char* kErrorNotActive = "IME is not active"; | 19 const char* kErrorNotActive = "IME is not active"; |
| 20 const char* kErrorWrongContext = "Context is not active"; | 20 const char* kErrorWrongContext = "Context is not active"; |
| 21 | 21 |
| 22 InputMethodEngine::KeyboardEvent::KeyboardEvent() { |
| 23 } |
| 24 |
| 25 InputMethodEngine::KeyboardEvent::~KeyboardEvent() { |
| 26 } |
| 27 |
| 28 InputMethodEngine::MenuItem::MenuItem() { |
| 29 } |
| 30 |
| 31 InputMethodEngine::MenuItem::~MenuItem() { |
| 32 } |
| 33 |
| 34 InputMethodEngine::Candidate::Candidate() { |
| 35 } |
| 36 |
| 37 InputMethodEngine::Candidate::~Candidate() { |
| 38 } |
| 39 |
| 22 InputMethodEngine::Observer::~Observer() { | 40 InputMethodEngine::Observer::~Observer() { |
| 23 } | 41 } |
| 24 | 42 |
| 25 class InputMethodEngineImpl | 43 class InputMethodEngineImpl |
| 26 : public InputMethodEngine, | 44 : public InputMethodEngine, |
| 27 public input_method::IBusEngineController::Observer { | 45 public input_method::IBusEngineController::Observer { |
| 28 public: | 46 public: |
| 29 InputMethodEngineImpl() | 47 InputMethodEngineImpl() |
| 30 : observer_(NULL), active_(false), next_context_id_(1), | 48 : observer_(NULL), active_(false), next_context_id_(1), |
| 31 context_id_(-1) {} | 49 context_id_(-1) {} |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 } else if (button & input_method::IBusEngineController::MOUSE_BUTTON_2_MASK) { | 407 } else if (button & input_method::IBusEngineController::MOUSE_BUTTON_2_MASK) { |
| 390 pressed_button = MOUSE_BUTTON_MIDDLE; | 408 pressed_button = MOUSE_BUTTON_MIDDLE; |
| 391 } else if (button & input_method::IBusEngineController::MOUSE_BUTTON_3_MASK) { | 409 } else if (button & input_method::IBusEngineController::MOUSE_BUTTON_3_MASK) { |
| 392 pressed_button = MOUSE_BUTTON_RIGHT; | 410 pressed_button = MOUSE_BUTTON_RIGHT; |
| 393 } | 411 } |
| 394 | 412 |
| 395 observer_->OnCandidateClicked(engine_id_, candidate_ids_.at(index), button); | 413 observer_->OnCandidateClicked(engine_id_, candidate_ids_.at(index), button); |
| 396 } | 414 } |
| 397 | 415 |
| 398 } // namespace chromeos | 416 } // namespace chromeos |
| OLD | NEW |