Prime Minister Justin Trudeau lent his star power to help Google Canada open its gigantic new engineering office in Kitchener, Ont., on Thursday.

Speaking to a packed room full of Google engineers, he said that while there was "troublesome news" about the economy coming out of Alberta, he hoped his visit would celebrate the bright spots and highlight his government's promise to invest in innovation and infrastructure.

He recounted how at a previous visit to Google's Montreal office he rode a unicycle and tried a climbing wall, and regretted that kind of photo opportunity didn't fit with "the stature that comes with my new job." He joked that there were limits to the public's tolerance for a "geek PM" who was once "halfway decent as a coder in [programming language] C++."

Story continues below advertisement

He started his visit with a photo op of children in a junior-engineer workshop, giving a virtual-reality tour of the House of Commons and getting a 3-D scan of his head, which the children intended to print into a plastic bust – or 3-D selfie – of the PM.

The former teacher also gave a quick intro into the philosophy of code writing, describing an algorithm as a step-by-step set of instructions for computers.

Questioned on whether Canada is doing enough to create code and tech education in schools, he agreed that "we need to do a much better job," without laying out any specific ideas, though he did reiterate his government's commitment to respect provincial jurisdiction.

Google's new office is the major tenant in a glass-and-steel building in downtown Kitchener, part of the redevelopment of a row of factories first built in 1902 and known as the Breithaupt Block. The U.S.-based company's Canadian arm has signed a 10-year deal to occupy 185,000 square feet of the facility. That more than doubles the company's previous footprint in town.

Google has been in the Kitchener-Waterloo area since 2005, and moved into the nearby redeveloped Tannery building in 2010. The new office will host more than 400 engineers working on hardware and software products for the global Internet giant.

The Prime Minister's remarks were part of a mini-tour of Ontario's innovation and technology sectors for Mr. Trudeau. Earlier in the day he made an announcement about water-filtration technology at the University of Waterloo, and had a tour of BlackBerry's headquarters.

Mr. Trudeau was in Toronto on Wednesday, visiting with Mayor John Tory and also to make a $20-million pledge to help the Centre for Commercialization of Regenerative Medicine develop a stem-cell therapy lab at the MaRS innovation centre.

Story continues below advertisement

Mr. Trudeau pledged during the election campaign to spend $900-million over three years to support technology accelerators and incubators like MaRS and the Kitchener-Waterloo region's Communitech, which is moving into part of Google's recently vacated space.