California Gov. Jerry Brown has signed "sanctuary state" legislation that extends protections statewide for immigrants living in the United States illegally.