OLD | NEW |
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 "chrome/browser/chromeos/input_method/input_method_engine_ibus.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_engine_ibus.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // TODO: Nested candidates | 269 // TODO: Nested candidates |
270 candidate_ids_.clear(); | 270 candidate_ids_.clear(); |
271 candidate_indexes_.clear(); | 271 candidate_indexes_.clear(); |
272 table_->mutable_candidates()->clear(); | 272 table_->mutable_candidates()->clear(); |
273 for (std::vector<Candidate>::const_iterator ix = candidates.begin(); | 273 for (std::vector<Candidate>::const_iterator ix = candidates.begin(); |
274 ix != candidates.end(); ++ix) { | 274 ix != candidates.end(); ++ix) { |
275 ibus::IBusLookupTable::Entry entry; | 275 ibus::IBusLookupTable::Entry entry; |
276 entry.value = ix->value; | 276 entry.value = ix->value; |
277 entry.label = ix->label; | 277 entry.label = ix->label; |
278 entry.annotation = ix->annotation; | 278 entry.annotation = ix->annotation; |
| 279 entry.description_title = ix->usage.title; |
| 280 entry.description_body = ix->usage.body; |
279 | 281 |
280 // Store a mapping from the user defined ID to the candidate index. | 282 // Store a mapping from the user defined ID to the candidate index. |
281 candidate_indexes_[ix->id] = candidate_ids_.size(); | 283 candidate_indexes_[ix->id] = candidate_ids_.size(); |
282 candidate_ids_.push_back(ix->id); | 284 candidate_ids_.push_back(ix->id); |
283 | 285 |
284 table_->mutable_candidates()->push_back(entry); | 286 table_->mutable_candidates()->push_back(entry); |
285 } | 287 } |
286 GetCurrentService()->UpdateLookupTable(*table_.get(), table_visible_); | 288 GetCurrentService()->UpdateLookupTable(*table_.get(), table_visible_); |
287 return true; | 289 return true; |
288 } | 290 } |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 DBusThreadManager::Get()->RemoveIBusEngineService(object_path_); | 574 DBusThreadManager::Get()->RemoveIBusEngineService(object_path_); |
573 | 575 |
574 current_object_path_++; | 576 current_object_path_++; |
575 object_path_ = dbus::ObjectPath(kObjectPathPrefix + | 577 object_path_ = dbus::ObjectPath(kObjectPathPrefix + |
576 base::IntToString(current_object_path_)); | 578 base::IntToString(current_object_path_)); |
577 GetCurrentService()->SetEngine(this); | 579 GetCurrentService()->SetEngine(this); |
578 sender.Run(object_path_); | 580 sender.Run(object_path_); |
579 } | 581 } |
580 | 582 |
581 } // namespace chromeos | 583 } // namespace chromeos |
OLD | NEW |