@Mahsa Rm, The initial posting of your question did not include the data file or the figure - at least I did not see them. That is why I simulated a signal. You can apply the idea in my code to your signals. However, your A and B signal appear to include step changes in the baseline. I wuld not call that drift because it is not a slow process - it is abrupt. A high pass filter removes drift (i.e. low frequency variation in the baseline), but it will not remove a step change in the baseline (which includes high frequencies). A low pass filter will not be suitable, because it would suppress the phsyiologically useful part of the EOG, as well as the step change. Therefore I would develop a more customized solution.
Move across the signal one point at a time. At each time point, compute the standard deviation and the mean of the M preceding points, and the s.d. and mean of the current point plus M-1 additional points. Average the 2 SD's. If the means differ by more than T times the average SD (where T=3 or 4 or 5 maybe), then a baseline shift has happened. The magnitude of the shift is the difference of the means. Shift the current point and all future points by that amount. Continue, point by point, along the signal, until done, because there may be more than one shift.
Then apply a highpass filter, as described in my previous answer, if you feel it is warranted.