The class of the diagonal in flag bundles