It is clear from the definition and right-invariance of the measure $dh$ that $Pf$ is left-invariant under $SL_2(\mathbb{A}_F)$. As Paul Garrett kindly explained, $Pf$ is also left-invariant under $GL_2(F)$, because $f$ is left-invariant under $GL_2(F)$ and $GL_2(F)$ normalizes the coset space $SL_2(F)\backslash SL_2(\mathbb{A}_F)$. As a result, for any $g\in GL_2(\mathbb{A}_F)$, we have
$$ Pf(g)=Pf\left(g\begin{pmatrix}\det g^{-1}&\\&1\end{pmatrix}\begin{pmatrix}\det g&\\&1\end{pmatrix}\right)=Pf\left(\begin{pmatrix}\det g&\\&1\end{pmatrix}\right).$$
This motivates the definition
$$\widetilde{Pf}(a):=Pf\left(\begin{pmatrix}a&\\&1\end{pmatrix}\right),\qquad a\in\mathbb{A}_F^\times.$$
The function $\widetilde{Pf}$ is clearly invariant under $F^\times$. Moreover, it satisfies the identity
$$\tag{$\ast$}\widetilde{Pf}(ab^2)=\omega(b)\widetilde{Pf}(a),\qquad a,b\in\mathbb{A}_F^\times,$$
since
$$Pf\left(\begin{pmatrix}ab^2&\\&1\end{pmatrix}\right)=Pf\left(\begin{pmatrix}b&\\&b\end{pmatrix}\begin{pmatrix}a&\\&1\end{pmatrix}\right)=\omega(b)\,Pf\left(\begin{pmatrix}a&\\&1\end{pmatrix}\right).$$
Now let us fix a decomposition $\mathbb{A}_F^\times=\mathbb{R}_{>0}\times \mathbb{A}_F^1$ and focus on the compact quotient $\mathbb{A}_F^1/F^\times$. We have a spectral decomposition
$$ \widetilde{Pf}(a)=\sum_\chi c_\chi \chi(a),\qquad a\in\mathbb{A}_F^1,$$
where $\chi$ runs through the (discrete set of) characters of $\mathbb{A}_F^1/F^\times$. Then ($\ast$) yields, by the uniqueness of the spectral coefficients, that $c_\chi\chi^2(b)=c_\chi\omega(b)$ holds for any $b\in\mathbb{A}_F^1$. That is, $c_\chi=0$ unless $\chi^2=\omega$ on $\mathbb{A}_F^1$. Any such $\chi$ extends uniquely to a character of $\mathbb{A}_F^\times/F^\times$ maintaining the property $\chi^2=\omega$, and one can verify, using ($\ast$) and existence of square-roots in $\mathbb{R}_{>0}$, that these extended idele class characters satisfy
$$ \widetilde{Pf}(a)=\sum_{\chi^2=\omega} c_\chi \chi(a),\qquad a\in\mathbb{A}_F^\times.$$
The coefficients $c_\chi$ can be evaluated by the orthogonality of characters,
\begin{align*} c_\chi&=\int_{\mathbb{A}_F^1/F^\times}\widetilde{Pf}(a)\,\overline{\chi(a)}\,da\\
&=\int_{\mathbb{A}_F^1/F^\times}\int_{h \in SL_2(F)\backslash SL_2(\mathbb{A}_F)}f\left(h\begin{pmatrix}a&\\&1\end{pmatrix}\right)\overline{\chi(a)}\,dh\,da\\
&=\int_{GL_2(F)\backslash GL_2^{(1)}(\mathbb{A}_F)}f(g)\,\overline{\chi(\det g)}\,dg,
\end{align*}
where $GL_2^{(1)}(\mathbb{A}_F)$ denotes the subgroup of adelic matrices whose determinant lies in $\mathbb{A}_F^1$. The result is immediate from here, since $f(g)\,\overline{\chi(\det g)}$ as a function on $GL_2(\mathbb{A}_F)$ is invariant under the center (recalling that $\chi^2=\omega$).