Every candidate does it: Plays to the base in the primaries, then moves to the center. (I guess McCain didn't really do it - he ticked off the base, but the base was divided, so he won anyway.)
But I think both McCain and Obama will not start moving to the middle so that can grab the more independent voters who decide elections. The Washington Post is giving Obama a cue:
The gap in Mr. Obama's Middle East policy remains Iraq. Mr. Obama has used his opposition to the war to distinguish himself politically from Sen. Hillary Rodham Clinton (D-N.Y.) and now from Mr. McCain. Yet, in doing so, he has become unreasonably wedded to a year-old proposal to rapidly withdraw all U.S. combat forces from the country -- a plan offered when he wrongly believed that the situation would only worsen as long as American troops remained. Remarkably, only a sentence or two about Iraq appeared in Mr. Obama's AIPAC speech, and advisers say he may visit the country in coming months. That would offer him the opportunity to outline a strategy based on sustaining the dramatic reduction in violence recorded this year. No, the left wouldn't like it, but it would be in keeping with Mr. Obama's pragmatic approach to the rest of the region.As for McCain, here's his first campaign ad:
Looks pretty centrist to me.