When one visits a store or mall to admire goods rather than to purchase them. The 'shopper' seems to be looking so intently at the glass in storefront windows that he appears to want to buy the window itself, hence 'window shopping'.
"You seem to be really interested in that sweater. Do you plan on getting it?"
"No, I'm just window shopping."