Add an is_enabled_for mechanism for NavigationBarHook.

This adds a way for NavigationBarHooks to be enabled/disabled per-user. This is
done by adding a new, optional is_enabled_for flag to the constructor, which is
a callable that returns either True or False.

Testing done:
- Ran unit tests.
- Used this in an extension.

Reviewed at https://reviews.reviewboard.org/r/6390/