DETROIT — Senator Kamala Harris of California structures her stump speech around two themes — “truth” and “justice” — meant to evoke her career as a barrier-breaking prosecutor and cultivate a reputation as a fearless public advocate.

But when Ms. Harris swept into Detroit to address an N.A.A.C.P. banquet on Sunday night, she added something new. After her signature windup of “let’s speak truth,” she replaced her usual recitation of Democratic policies with an attack on President Trump, accusing him of enabling bigotry and divisiveness and refusing “to call neo-Nazi violence what it is: domestic terrorism.”

“This president isn’t trying to make America great,” she said, “he’s trying to make America hate.”

With that, Ms. Harris was nodding to a political truth: She is attempting to reset her campaign after stagnating in Democratic primary polls, using her strengths as a prosecutor — which were on display during a recent face-off with Attorney General William Barr — to mount a sharp indictment of Mr. Trump.

Ms. Harris entered the 2020 race in January seeking to make history as the first black female president, and drew 20,000 people to her campaign kickoff in Oakland and a burst of donations that helped her emerge as the No. 2 fund-raiser in the Democratic field through March. But from the start, she has found herself in a political vise, squeezed by competing factions in her party and even in her own campaign, which has led to some stumbles.