We study Anderson localization of massless two-dimensional Dirac electrons in random one-dimensional scalar and vector potentials theoretically for two different cases, in which the scalar and vector potentials are either uncorrelated or correlated. From the Dirac equation, we deduce the effective wave impedance, in which we derive the condition for total transmission and those for delocalization in our random models analytically. Based on the invariant imbedding theory, we also develop a numerical method to calculate the localization length exactly for arbitrary strengths of disorder. In addition, we derive analytical expressions for the localization length, which are extremely accurate in the weak and strong disorder limits. In the presence of both scalar and vector potentials, the conditions for total transmission and complete delocalization are generalized from the usual Klein tunneling case. We find that the incident angles at which electron waves are either completely transmitted or delocalized can be tuned to arbitrary values. When the strength of scalar potential disorder increases to infinity, the localization length also increases to infinity, both in uncorrelated and correlated cases. The detailed dependencies of the localization length on incident angle, disorder strength, and energy are elucidated and the discrepancies with previous studies and some new results are discussed. All the results are explained intuitively using the concept of wave impedance.