Code:    void MaybeStartInputMethodDaemon(const std::string& section,
                                    const std::string& config_name,
                                   const ImeConfigValue& value) {
     if (section == language_prefs::kGeneralSectionName &&
         config_name == language_prefs::kPreloadEnginesConfigName &&
        value.type == ImeConfigValue::kValueTypeStringList &&
         !value.string_list_value.empty()) {
      if (ContainOnlyOneKeyboardLayout(value) || defer_ime_startup_) {
        return;
      }

      const bool just_started = StartInputMethodDaemon();
      if (!just_started) {
        return;
      }

      if (tentative_current_input_method_id_.empty()) {
        tentative_current_input_method_id_ = current_input_method_.id;
      }

      if (std::find(value.string_list_value.begin(),
                    value.string_list_value.end(),
                    tentative_current_input_method_id_)
          == value.string_list_value.end()) {
        tentative_current_input_method_id_.clear();
      }
    }
  }

Commit Message: Remove use of libcros from InputMethodLibrary.

BUG=chromium-os:16238
TEST==confirm that input methods work as before on the netbook. Also confirm that the chrome builds and works on the desktop as before.

Review URL: http://codereview.chromium.org/7003086

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89142 0039d316-1c4b-4281-b951-d872f2087c98
CWE ID: CWE-399
   void MaybeStartInputMethodDaemon(const std::string& section,
                                    const std::string& config_name,
                                   const input_method::ImeConfigValue& value) {
     if (section == language_prefs::kGeneralSectionName &&
         config_name == language_prefs::kPreloadEnginesConfigName &&
        value.type == input_method::ImeConfigValue::kValueTypeStringList &&
         !value.string_list_value.empty()) {
      if (ContainOnlyOneKeyboardLayout(value) || defer_ime_startup_) {
        return;
      }

      const bool just_started = StartInputMethodDaemon();
      if (!just_started) {
        return;
      }

      if (tentative_current_input_method_id_.empty()) {
        tentative_current_input_method_id_ = current_input_method_.id;
      }

      if (std::find(value.string_list_value.begin(),
                    value.string_list_value.end(),
                    tentative_current_input_method_id_)
          == value.string_list_value.end()) {
        tentative_current_input_method_id_.clear();
      }
    }
  }
