SHANGHAI — Even before Google began threatening to shut down its search service in China, it was not fitting in.