Terminological inexactitude abounds!
R H Angier's 'bible' on the subject is titled 'Firearm Blueing and Browning'. It was published in 1936. It seems that chemical browning dates back probably before the 1600s, and seems to have been a refined form of rusting, coating the iron with red/brown ferrous oxide. 'Temper blueing' was also used around the same time, the colour being produced by heating, giving the progressive oxide film build-up that we're familiar with – and as used by clock-makers – to get a distinct deep blue colour.
Nowadays, the commonest gun finish is chemical blackening, but it's still often loosely called blueing or browning. This finish can be obtained by boiling a rust-browned part in water. This converts the red/brown oxide to black oxide. Traditional rust-browning – or blueing – is a very tedious process indeed, but it's safe, for instance on shotguns, which are traditionally soft-soldered together.
Currently-available 'Cold blues' are commonly based on Selenium salt deposition, but are not durable, and the colour depth is often poor. However, it's a useful 'touch-up' process.
Angier provides numerous recipes for chemically colouring iron/steel, but most of them sound more like alchemy than elegant chemistry. Many are based on, or contain, arsenical or chromium compounds, and other nasties.
An easy, proper, black oxide finish can be got with a mixture of Sodium Hydroxide (8 parts) and Potassium Nitrate (5 parts) in water, the parts being boiled for about 10 minutes in it, at about 140 C, the boiling temperature determined by the mixture's water content. It's a nasty, hot, dangerous, corrosive mixture, so be careful, especially if needing to add more water, and good luck getting the chemicals. Needless to say, everything must be scrupulously cleaned and de-greased*. The coloured finish is then oiled and perhaps waxed. It's really the oil or wax that slows down any subsequent rusting process, because the oxide coat alone is porous.
(Neither I, nor the management of this forum will take any responsibility for anything that occurs as a result of this posting, and Angier's dead. You know the drill…)
* and if anyone thinks that a wipe down with acetone will properly de-grease a surface, they are sadly mistaken!