With Jim Harbaugh likely to bring a Stanford assistant with him to the 49ers, Mike Johnson is headed back to college.

Johnson, who became the 49ers’ offensive coordinator last season, will become the offensive coordinator at UCLA, according to Scout.com.

A source told the Mercury News that Harbaugh had informed Johnson﻿ he might still have a role on the 49ers’ staff, just not as offensive coordinator.

Even before Johnson’s departure, the 49ers were zeroing in on Greg Roman or David Shaw as their next potential coordinator. Roman is Stanford’s associate head coach, and Shaw is the team’s offensive coordinator. Both also are candidates to replace Harbaugh as Stanford’s head coach.

A source confirmed that Roman will have the opportunity to join the 49ers’ staff if he is not named Stanford’s new coach. Roman worked in the NFL from 1995-2007 as an assistant with Carolina, Houston and Baltimore. Shaw also has NFL experience, having worked from 1997-2006 with Philadelphia, the Raiders, Baltimore and San Diego.

Johnson lasted 13 games as the 49ers’ offensive coordinator. The former quarterbacks coach was promoted when Mike Singletary fired Jimmy Raye after a 31-10 loss at Kansas City in Week 3.

Johnson had mixed results. The 49ers offense perked up at times, including a 40-point game against Seattle and a 38-point output against Arizona over the final month.

But Johnson also presided over a 21-0 loss to Tampa Bay, the first time the 49ers had been shut out at home since 1977.

UCLA officials did not confirm the hiring, and Johnson did not immediately return a call to his cell phone. Norm Chow, the Bruins’ current offensive coordinator, has not been fired and is due $1 million over the next two years.

Harbaugh, a longtime NFL quarterback, will have a major influence in the 49ers’ offensive game plan. The play-calling responsibility at Stanford was a well-kept secret, with each offensive assistant specializing in an area such as third-down calls or red-zone plays.

Johnson’s departure extends the 49ers’ annual tradition of changing offensive coordinators. They have had a new play-caller every year since Greg Knapp held the job from 2001-03.

They hired Ted Tollner (2004), Mike McCarthy (2005), Norv Turner (2006), Jim Hostler (2007), Mike Martz (2008), Jimmy Raye (2009-10) and Johnson (2010).

Mercury News writers Tim Kawakami and Elliott Almond contributed to this report.