Federer will keep his #1 ranking until the end of RG at the very least. However I agree that he will likely lose it after Wimbledon - perhaps even if he defends his title there. In the event that Federer falls at week #285 (one week short of tying the record), then the post-Wimbledon outlook becomes very important - where aside from Cincy he potentially has points to gain. But then again, Nadal will also have ample opportunities to pick up points to keep ahead until the end of 2010.
Post Wimbledon, Nadal has points to gain but not potentially as much as Federer. Roger has a QF at Canada, win at Cincy, Final at US, and just a final at Basel. Nadal has a SF at Paris, Beijing and Cincy (I think), SF at US, F at Shanghai. The worst chunk of points for Nadal comes at the WTF where he has 1500 points to gain!!!