In among Jacob Riis' NYC slum photos, are several showing squalid, but nevertheless indoor and flush, toilets. By 1912, even (all but the lowest of) urban slums in the U.S.had flush toilets. They were communal, at the end of the hall, and to judge from photographic evidence you'd probably RATHER have used a chamber pot.
The first advertising blitz regarding indoor toilets, aimed at the middle class, seems to have begun quietly around the early 1880s. By the 1890s, ads stressing the convenience and health aspects of the modern bathroom were common, and the first of the ads making you feel that you were, somehow, socially inferior if you did NOT have a sparkling, white, easily cleaned bathroom were appearing. These became the norm by about 1905.
Likewise in Britain by the end of the nineteenth century, when public health was an issue taken very seriously. Working class terraced housing in urban areas didn't have bathrooms but building regulations required each house to have a water closet, usually brick-built as a lean-to construction attached to the back end of the house - thus very close to the back door but not directly accessible from inside the house.
The privy at the end of the garden could still be found in some older properties, along with communal toilet blocks for the oldest urban housing built in the back-to-back or courtyard styles which by then were generally regarded as slums. Not for nothing was that name derived from the older word slump (swamp). I've been around long enough to have experienced all of these 'conveniences'!