Refactor some common code for bounding boxes.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1373333002 .
1 file changed