The Toronto Maple Leafs and restricted free-agent winger Mitch Marner have agreed to a six-year deal, the team announced Friday, ending one of the most controversial negotiations of the NHL offseason.