“I’d love him to be a team player, possibly he won’t be,” Mr. Trump said. The president noted that he had endorsed Mr. Romney for the Senate, and Mr. Romney, in turn, had praised him “profusely.” Then Mr. Trump added that Mr. Romney’s words might not play well in Utah, where the president said he is extremely popular. (Mr. Trump is probably less popular in Utah than almost any largely Republican state.)

He went on to criticize Mr. Romney’s race against Mr. Obama in 2012, and said that if Mr. Romney had fought Mr. Obama as hard as he has fought him, Mr. Romney might have won. And when asked if he were concerned about a primary challenge from Mr. Romney in 2020, Mr. Trump replied, “They say I am the most popular president in the history of the Republican Party.” (Actually, Mr. Trump’s approval rating among Republicans was 88 percent at 701 days into his term, according to Gallup, the same as President George W. Bush at the same point. Over all, Mr. Trump’s approval ratings among his own party have largely hovered below Mr. Bush’s.)

Cabinet members know the value of praise.

One by one, the president called on select cabinet members for their contributions to border security. One by one, they responded by praising their boss.

Kirstjen Nielsen, the homeland security secretary, applauded his leadership on border security. She was followed by the acting attorney general, Matthew G. Whitaker, who saluted the president for giving up his Christmas and New Year’s holidays “while some members of Congress went on vacation.” Rick Perry, the energy secretary and a former governor of Texas, also praised the president, saying he had been rebuffed on border security from the Obama administration. “You’re standing up and saying don’t come,” Mr. Perry said.

Not to be outdone, Vice President Mike Pence noted that he, too, stayed in Washington over the holidays. Then he, too, piled on the compliments: “I want to thank you for the strong stand you have taken on border security.”

Syria and ISIS are on Mr. Trump’s mind.

Mr. Trump was still stinging from criticism over his decision to withdraw American troops from Syria, lamenting that he was the only person who would get “bad publicity” for it. One rebuke in particular, from Mr. Mattis, seemed to prompt the president to issue some criticism of his own.

“How has he done in Afghanistan? Not good. I’m not happy,” Mr. Trump said, before adding, “I wish him well. President Obama fired him and, essentially, so did I.” (Mr. Mattis resigned in protest, and Mr. Trump initially characterized the retired Marine general’s departure as a retirement.)