Google parent company Alphabet has agreed to devote $310 million to diversity, equity and inclusion efforts as part of a settlement with shareholders after several executives in the company, including its former top lawyer, faced allegations of sexual misconduct or discrimination.