President Trump is barnstorming the country as a get-out-the-vote evangelist for Republicans, preaching that Tuesday’s midterm elections are “a referendum about me.”

He may get more than he bargained for, and California is likely to play a large role in that.

The results will probably lead to a Californian becoming speaker of the House. But it remains to be seen if the chamber will be led by a determined check on Trump like San Francisco Democrat Nancy Pelosi, or a champion of his agenda like Bakersfield Republican Kevin McCarthy.

What happens Tuesday also will shape the federal government’s policy on two issues that poll high on the list of Californians’ concerns: immigration and the environment.

And the results in the state’s seven tightly contested, GOP-held House districts could either deliver a knockout punch to the California Republican Party or deflate the Trump resistance at ground zero.

While nobody in the Republican Party can rally its core voters like Trump, the president’s harsh pre-election rhetoric could come with a cost, said James Taylor, a professor of political science at the University of San Francisco.

“Donald Trump staying in campaign mode is a sign of political genius and a sign of political weakness,” Taylor said. “It’s ominous also, because it’s not sustainable (for Republicans) two or three election cycles down the road.”

Here’s what’s at stake for California on Tuesday:

Leadership in Washington: The most immediate spoil of winning the majority in either house of Congress is leadership. The ruling party controls everything from the chamber floor down to the subcommittees.

McCarthy, the GOP majority leader, and Minority Leader Pelosi are both favorites to retain their positions in the party hierarchy, although neither is an outright lock. Several Democratic candidates have said the party should look to someone besides Pelosi, a longtime lightning rod for GOP attacks, but she retains substantial support in the caucus.

Among the Republicans, McCarthy is the heir apparent to move up from the No. 2 job with Speaker Paul Ryan of Wisconsin retiring, though he faces potential holdouts among more conservative members. A fellow San Joaquin Valley Republican, Rep. Jeff Denham of Turlock (Stanislaus County), told The Chronicle, “I have not heard of a race at all. McCarthy will be our next speaker as long as we hold the majority.”

Leadership has ripple effects throughout the committees. Burbank Democratic Rep. Adam Schiff, for example, would probably take over the House Intelligence Committee, putting him in charge of the direction of the investigation into Russian meddling in the 2016 election as well as oversight of the nation’s surveillance apparatus.

It’s not just about whether the House flips. The size of the majority matters, too.

If a GOP majority is slim, it could give outsize influence to a group of conservatives known as the Freedom Caucus, who often refuse to support legislation that doesn’t meet their strict litmus tests. Ironically, that could give Democrats leverage to negotiate with a Speaker McCarthy for votes.

Similarly, a narrow Democratic majority could expose intraparty divisions, especially between Pelosi allies on the one hand and, on the other, members from red-leaning districts who campaigned on opposing her and strongly progressive new members who have also distanced themselves.

Immigration: If Republicans retain control of Congress after Trump made immigration a wedge issue in the campaign’s closing days, they could take it as a mandate to fund a wall on the Mexican border and enact other aggressive immigration measures. That would be the case even — and maybe especially — in places such as California that limit officials’ cooperation with federal enforcement efforts.

A Democratic House or Senate doesn’t make it much more likely that immigration reform could happen, either. Trump would have veto power over anything that came out of Congress, and lawmakers of both parties looking ahead to a 2020 presidential race would have little incentive to compromise.

There would be a slim chance of a deal on the Deferred Action for Childhood Arrivals policy, which protects young undocumented immigrants who came to the U.S. as minors. Trump has tried to kill the policy, which covers nearly 700,000 people, 200,000 of them in California. But he has also indicated at times that he would be open to a deal if it included Democratic concessions such as funding for a border wall and limits on legal immigration.

Nevertheless, he has walked away from every deal offered to him, and Democrats show no appetite for engaging him further.

With little chance of an immigration agreement, Pelosi-led Democrats would probably focus on oversight of how the Trump administration handles the issue. They could schedule hearings on family separations, troop deployments to the border and the treatment of immigrants in detention, slowing down the administration’s other initiatives.

“I think most importantly, it will mean oversight of the actions of the Department of Homeland Security and Department of Justice,” said Ali Noorani, executive director of the immigration advocacy group the National Immigration Forum. “How are the agencies spending resources, how are people being treated in detention? I think the list of things to look into by Congress is getting longer day by day.”

Environment: As with immigration, a Democratic House would have little chance of enacting policy — but could harass the administration by scrutinizing changes it has made through the Environmental Protection Agency and Interior Department.

For example, congressional Democrats could entangle the EPA in investigations into its plans to revoke California’s authority to set stricter standards than the federal government’s for vehicle emissions of greenhouse gases.

“Congress can certainly slow things down,” said Andy Kelley, communications director with the California League of Conservation Voters.

Likewise, the House Natural Resources Committee would be “hard-pressed to consider” the Trump administration’s proposal to sell off public lands to private corporations, with at least six California Democrats expected to be part of the committee majority, Kelley said.

On Thursday a federal judge struck down a California law that sought to give the state more power to override the sale of federal lands. State lawmakers passed the law last year to make it harder to develop, log or drill for oil on some of the 46 million acres the federal government owns in California.

A Democratic House majority may also be able to stall Trump’s proposal to increase oil drilling off the coast, an idea that polls show is widely unpopular in California.

Resistance morale: If the Democrats don’t at least win the House, “I think it will suck the oxygen right out of their sails,” said John Thomas, a GOP pollster and strategist in Los Angeles. “They will have an existential crisis.”

Taylor, the University of San Francisco professor, said a loss “will have a demoralizing effect” on the grassroots energy that was stoked by groups such as Indivisible and Swing Left that formed in reaction to Trump’s victory two years ago. They will “know that they lost in 2016 and 2018 to this man who who has done everything he could to sabotage his own party,” Taylor said.

But Aram Fischer, a San Franciscan who is a top California organizer for Indivisible, which claims up to 200,000 members in the state, said the grassroots won’t wilt if Republicans hold the House because “the recruiter-in-chief will still be there.”

“And whether it’s the climate or education or health care, concerns about those issues are still there,” Fischer said. “That’s what’s animating people.”

Republicans’ pulse: Only 14 Republicans are in California’s 53-member House delegation, and the party might take it as a victory if its losses Tuesday are limited to two seats, Thomas said.

One race in particular is key: the Orange County contest between Republican Young Kim and Democrat Gil Cisneros to fill an open seat now held by the GOP. If the Korean-born Kim prevails, Thomas said, “look for the Republicans to try to run more Asian American women” as a baby step toward regaining relevancy statewide.

But as Trump has said, this is a referendum about him. And for a president famously unwilling to give an inch or admit defeat, there may be no such thing as a loss.

“If Donald Trump can take away from the night that he won the Senate and maybe gained a seat or two, then he will point to his campaign efforts wherever they won,” Taylor said.

“That man,” he added, “can turn a two into a 10.”

Joe Garofoli is The San Francisco Chronicle’s senior political writer, and Tal Kopan is The Chronicle’s Washington correspondent. Email: jgarofoli

@sfchronicle.com, tal.kopan@sfchronicle.com Twitter: @joegarofoli, @TalKopan