Global Solutions for the gravity water waves system: Infinite depth setting and flat bottom setting