The 24-year-old goalkeeper enjoyed two loan spells at Gigg Lane this season before making the move permanent.
The Irishman has found chances few and far between in the Premier League and will join the Shakers on July 1.
"From our point of view, it's a positive that he came for a month or two, then decided he wanted to come back and now he's decided he wants to join us permanently," Barker told the Manchester Evening News.
"I think he's realised, at his age, he needs to be playing regular first-team football and he needs a first-team football home as opposed to constantly going out on loan.
"I think he enjoyed being a part of what we were trying to do but he put himself in the window when he came and had a few months with us, so it's a bit of a feather in our cap that we've managed to get him."