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

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

Issue 14027007: Add sanity check for deprecated component extension IME. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revises comments Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_manager_impl.h" 5 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h"
6 6
7 #include <algorithm> // std::find 7 #include <algorithm> // std::find
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 if (!pending_input_method_.empty()) { 341 if (!pending_input_method_.empty()) {
342 ChangeInputMethod(pending_input_method_); 342 ChangeInputMethod(pending_input_method_);
343 pending_input_method_.clear(); 343 pending_input_method_.clear();
344 } 344 }
345 345
346 } 346 }
347 347
348 void InputMethodManagerImpl::LoadNecessaryComponentExtensions() { 348 void InputMethodManagerImpl::LoadNecessaryComponentExtensions() {
349 if (!component_extension_ime_manager_->IsInitialized()) 349 if (!component_extension_ime_manager_->IsInitialized())
350 return; 350 return;
351 for (size_t i = 0; i < active_input_method_ids_.size(); ++i) { 351 // We have to do sanity check here, because some component extension IMEs may
satorux1 2013/04/15 08:31:32 sanity check may be unclear. What about: Load com
Seigo Nonaka 2013/04/16 07:17:03 Sure thanks! Done.
352 if (component_extension_ime_manager_->IsWhitelisted( 352 // be removed. So if specified component extension IME is no longer existing,
satorux1 2013/04/15 08:31:32 may be removed -> might have been removed from the
Seigo Nonaka 2013/04/16 07:17:03 Done.
353 active_input_method_ids_[i])) { 353 // falling back to existing IME.
satorux1 2013/04/15 08:31:32 fall back to an existing IME.
Seigo Nonaka 2013/04/16 07:17:03 Done.
354 std::vector<std::string> unfiltered_input_method_ids =
355 active_input_method_ids_;
356 active_input_method_ids_.clear();
357 for (size_t i = 0; i < unfiltered_input_method_ids.size(); ++i) {
358 if (!component_extension_ime_manager_->IsComponentExtensionIMEId(
359 unfiltered_input_method_ids[i])) {
360 // Legacy IMEs or xkb layouts are active alwayes.
satorux1 2013/04/15 08:31:32 always active
Seigo Nonaka 2013/04/16 07:17:03 Done.
361 active_input_method_ids_.push_back(unfiltered_input_method_ids[i]);
362 } else if (component_extension_ime_manager_->IsWhitelisted(
363 unfiltered_input_method_ids[i])) {
354 component_extension_ime_manager_->LoadComponentExtensionIME( 364 component_extension_ime_manager_->LoadComponentExtensionIME(
355 active_input_method_ids_[i]); 365 unfiltered_input_method_ids[i]);
366 active_input_method_ids_.push_back(unfiltered_input_method_ids[i]);
356 } 367 }
357 } 368 }
358 } 369 }
359 370
360 void InputMethodManagerImpl::ActivateInputMethodProperty( 371 void InputMethodManagerImpl::ActivateInputMethodProperty(
361 const std::string& key) { 372 const std::string& key) {
362 DCHECK(!key.empty()); 373 DCHECK(!key.empty());
363 ibus_controller_->ActivateInputMethodProperty(key); 374 ibus_controller_->ActivateInputMethodProperty(key);
364 } 375 }
365 376
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 candidate_window_controller_.reset( 791 candidate_window_controller_.reset(
781 CandidateWindowController::CreateCandidateWindowController()); 792 CandidateWindowController::CreateCandidateWindowController());
782 if (candidate_window_controller_->Init(ibus_controller_.get())) 793 if (candidate_window_controller_->Init(ibus_controller_.get()))
783 candidate_window_controller_->AddObserver(this); 794 candidate_window_controller_->AddObserver(this);
784 else 795 else
785 DVLOG(1) << "Failed to initialize the candidate window controller"; 796 DVLOG(1) << "Failed to initialize the candidate window controller";
786 } 797 }
787 798
788 } // namespace input_method 799 } // namespace input_method
789 } // namespace chromeos 800 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698