IANAL
But a lawyer, if you paid one, would probably talk to you about managing risk. I think both your legal obligations (you would want to look at both copyright and terms of use) and your risk of getting sued depend more on your use case than anything else. Are you going to sell this Chrome Extension you're building? Or use it to compete against StackOverflow and re-direct people to your own Q&A site? If you were building this Chrome Extension just for you and your family to more efficiently browse the SO site, it's hard to imagine your getting sued and it's hard to imagine your losing if you were.
It's worth looking at the Stack Overflow legal statement.
The Network and its contents are
intended solely for the use of the
Network Subscribers and may only be
used in accordance with the terms of
this Agreement. All materials
displayed or performed on the Network,
including, but not limited to text,
graphics, logos, tools, photographs,
images, illustrations, software or
source code, audio and video, and
animations (collectively, “Content”)
(other than Content posted by
Subscriber (“Subscriber Content”)) are
the property of Stack Overflow and/or
third parties and are protected by
United States and international
copyright laws.
The Network is protected by copyright
as a collective work and/or
compilation, pursuant to U.S.
copyright laws, international
conventions, and other copyright laws.
Other than as expressly set forth in
this Agreement, Subscriber may not
copy, modify, publish, transmit,
upload, participate in the transfer or
sale of, reproduce (except as provided
in this Section), create derivative
works based on, distribute, perform,
display, or in any way exploit, any of
the Content, software, materials, or
Services in whole or in part.
This seems to explicitly rule out derivative works; on the other hand, is your use case much like personal use? That exemption is there to rule out your violating copyright law by browser caching or any similar technology which they obviously don't want to be illegal, and I suspect it would apply to a lot of personal use of browser extensions as well. Also, consider the factors for fair use: How much code are you taking? For what purpose? Are you competing with the original site, attempting to make money off of their hard labor, or abusing their server resources? Unlikely, but are you using it for scholarly purposes, criticism or parody?
More generally (and this gets back to the question of risk), are you using their code in a way that they would like or one they would disapprove of? Asking permission is clearly the polite thing to do, and it will also help resolve some of these questions.