I suspect it was all done in advance, allowing you to just walk off the ship -- the passenger manifest and passport info was probably all given to Canadian authorities before the ship arrived, or while docking but before passengers were allowed off.
That is how it was done when my ship arrived in Portugal; in New Zealand, we all had to get stamped approval from customs regarding items entering the country - they're pretty strict about that and have some rules that aren't typical in many other countries.