@xiefei
You are correct regarding market share and Google's refusal to comply with Chinese laws - whether they be censorship or other. Yahoo complied.
Google refused to obey the laws of China - so they exited - that's a fair business decision on their part - however, they don't have responsibility for maintaining peace, law, and civil order in China. Google and their applications were also being used a la American style, for other gray and blatantly criminal activities - such as narcotics, prostitution, porn, etc. These things continue to be rampant in western countries - the USA currently imports over USD 40 BILLION in recreational drugs from Mexico alone. With a population 4-5x the size of the USA with considerably less sophistication - such a market would become uncontrollable - once again creating warlords, fiefdoms, slavery, and misery as opposed to social responsibilities, poverty reduction, and continuously opening and maturing markets. China recently took down the Chongqing clique - regardless of whether the crackdown was politically motivated - that kind of rampant corruption must be decapitated. FORTUNATELY, this activity was pruned early enough to NOT require activating the military - as happened previously in certain other provinces, where corruption was rampant - infecting government, police, and military.
I obviously have a different if not rather negative opinion of google's perception of social responsibility - as China is a massively developing country with many needs - to include the benefits of google's tech - yet they chose to exit as opposed to working with the government in place to make this world and this country a better place. Why would they do that? Their decision tree is definitely much more complicated than a mere compliance with China's laws - which can sometimes be invasive, such as the latest, but recently muted requirement to allow backdoors into all IT equipment (that was a silly request and easily accomplished via your alleged Baidu solution).
Google's exit - to me - reeks of scapegoat-ism, finger-pointing, and something else. China is of course a hostile business environment - not specifically directed at or limited to google - but across all markets - both domestic and multinational - rampant theft of IP, customer databases, and other force majeur operating issues. Business here is truly akin to open commercial warfare - minus the WMDs (weapons of mass destruction) "surgical" assassinations (drone strikes), and "rendition programs" (global kidnapping and incarceration), and "aggressive interrogations" (torture).
This is an extraordinarily competitive place to do business, where competitive advantages, corporate secrets, and market share are difficult to maintain, much less grow and expand.
As the sole major IT company to exit China - their motives and operations become highly suspect. We only hear and see what the media shows - but the sole exit of a major multinational firm from this particular market reeks of something much more insidious within Google's allegedly hallowed walls. Amazon's still here, IBM, Yahoo, Apple, HP, Microsoft - the list is endless - why only Google? What were they doing, that created such an antagonistic and abrasive relationship with the government?
Personally, I liken Google to another incarnation of the very late Howard Hughes empire - a similarly eccentric if not insidious tale of incredible business acumen...worthy of disclose.tv...