I had wanted to compose an answer for Making a symlink for a bin file and renaming it to "readme" (w/o extension) gives it text file properties quoting the relevant part of the source code that chose file icons based on file name.
After spending considerable time doing some digging, I was unable to find it in the Unity source or the compiz source, and the GNOME source (where I suspect this is) consists of a huge number of projects that I had extreme difficulty searching. I was unable to come up with any information that I could use in an answer, and the mission was a failure.
So my question is: Where is some source relevant to the determination of human-readable file type descriptions and desktop icon selection for files on Ubuntu (14.04, and these features have been around for a while so I don't think it really matters which version of the components are in use)? Or at least, which projects might this source be in?
The part I'm looking for is that final step of "figure out the icon", which is of course based on e.g. the icon specified in a .desktop file, or a registered icon for another type of file, or a built-in default icon, etc.