diff options
author | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-12 13:00:15 +0000 |
---|---|---|
committer | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-12 13:00:15 +0000 |
commit | d01bb807aad3a4c2095954dc0cc3342a41323e46 (patch) | |
tree | f9424bcf5098d9f290cfd123979b06a691571698 /chrome/browser/chromeos/cros | |
parent | ca449f177da1a0592b05f1f69249ebdc0342c6b6 (diff) | |
download | chromium_src-d01bb807aad3a4c2095954dc0cc3342a41323e46.zip chromium_src-d01bb807aad3a4c2095954dc0cc3342a41323e46.tar.gz chromium_src-d01bb807aad3a4c2095954dc0cc3342a41323e46.tar.bz2 |
Simplify Preferences::SetPreloadEngines() function.
Stop using SetInputMethodActivated cros API and use the generic API, SetImeConfig, instead. This fix greatly reduces total number of ibus_config_set_value() calls.
I'm still not 100% certain, but this change might fix crosbug.com/2471, "Fails to activate an input method occasionally." ibus-daemon seems to ignore too frequent ibus_config_set_value("general", "preload_engines", ...) calls.
BUG=crosbug.com/2471
TEST=see the bug
Review URL: http://codereview.chromium.org/1596021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44241 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/cros')
-rw-r--r-- | chrome/browser/chromeos/cros/cros_in_process_browser_test.cc | 10 | ||||
-rw-r--r-- | chrome/browser/chromeos/cros/language_library.h | 1 |
2 files changed, 3 insertions, 8 deletions
diff --git a/chrome/browser/chromeos/cros/cros_in_process_browser_test.cc b/chrome/browser/chromeos/cros/cros_in_process_browser_test.cc index 3baaf5e5..6d5c99b 100644 --- a/chrome/browser/chromeos/cros/cros_in_process_browser_test.cc +++ b/chrome/browser/chromeos/cros/cros_in_process_browser_test.cc @@ -98,21 +98,15 @@ void CrosInProcessBrowserTest::SetLanguageLibraryStatusAreaExpectations() { .Times(1) .RetiresOnSaturation(); EXPECT_CALL(*mock_language_library_, GetActiveInputMethods()) - .Times(2) - // Don't use WillRepeatedly since the fucntion should be evaluated twice. - .WillOnce(Return(CreateFallbackInputMethodDescriptors())) - .WillOnce(Return(CreateFallbackInputMethodDescriptors())) - .RetiresOnSaturation(); - EXPECT_CALL(*mock_language_library_, SetInputMethodActivated(_, _)) .Times(1) - .WillOnce((Return(true))) + .WillOnce(Return(CreateFallbackInputMethodDescriptors())) .RetiresOnSaturation(); EXPECT_CALL(*mock_language_library_, current_ime_properties()) .Times(1) .WillOnce((ReturnRef(ime_properties_))) .RetiresOnSaturation(); EXPECT_CALL(*mock_language_library_, SetImeConfig(_, _, _)) - .Times(4) + .Times(5) .WillRepeatedly((Return(true))) .RetiresOnSaturation(); EXPECT_CALL(*mock_language_library_, RemoveObserver(_)) diff --git a/chrome/browser/chromeos/cros/language_library.h b/chrome/browser/chromeos/cros/language_library.h index 853283a..efc49fd 100644 --- a/chrome/browser/chromeos/cros/language_library.h +++ b/chrome/browser/chromeos/cros/language_library.h @@ -55,6 +55,7 @@ class LanguageLibrary { // Sets whether the input method specified by |input_method_id| is // activated. If |activated| is true, activates the input method. If // |activate| is false, deactivates the input method. + // TODO(yusukes): Probably we can remove this function. virtual bool SetInputMethodActivated(const std::string& input_method_id, bool activated) = 0; |