OK - there is a LOT misinformation about referrers.
What is a referrer?
The referrer, or HTTP referrer—also known by the common misspelling referer that occurs as an HTTP header field—identifies, from the point of view of an internet webpage or resource, the address of the webpage of the resource which links to it.
By checking the referrer, the new page can see where the request came from. Referrer logging is used to allow websites and web servers to identify where people are visiting them from, for promotional or security purposes.
Referrer is a popular tool to hxxp://www.baidu.com combat cross-site request forgery, but such security mechanisms do not work when the referrer is disabled. Referrer is widely used for statistical purposes.
Example 3.
What if our Google.com url links to someting external Page C. Click the link, the iframe now shows page C. What is the referrer for C?
Most browsers report that referrer is B (Google.com).
Example 4.
What if you nest iframes in Iframes etc.?
Well Always look at the page where the link is located. The closest containing page will always be the referrer for the link.
If you have nested iframes the referrer for the iframe is the closest containing iframe or page.