In a medium saucepan, combine milk, granulated sugar, flour and salt until well blended. Cook over medium heat, stirring constantly, until mixture thickens and comes to a boil.
Remove from heat.
Whisk about 1 cup hot mixture into eggs. Slowly pour egg mixture into saucepan, whisking constantly. Cook over medium-low heat, stirring constantly with a wooden spoon, until very thick, about 1 minute.
Remove from heat.
Spoon 2 1/2 cups hot pudding into medium bowl; stir in semisweet chocolate until smooth.
Add white chocolate to remaining pudding in saucepan; stir until smooth.
Let cool for about 30 minutes, whisking each puddings occasionally to keep a skin from forming.
Spoon half of semisweet chocolate pudding into a 6-cup, straight-sided glass bowl; refrigerate for 10 minutes. Top with white-chocolate pudding; refrigerate for 10 minutes. Spoon remaining chocolate pudding on top. Refrigerate until set, about 3 hours.
Whip heavy cream and confectioners' sugar until mixture is stiff. Spoon on top of pudding and sprinkle with chocolate shavings, if desired.