A gunman opened fire and injured one person before being taken down at a mosque in Norway, and officials said the suspect may have been motivated by extremist, anti-immigrant views.