Pass user agent along like http referrer and set user agent in C++

This commit is contained in:
Paul Betts 2015-05-05 21:01:41 -07:00
parent 4a8d7c1819
commit e4d90f747f
3 changed files with 14 additions and 6 deletions

View file

@ -418,6 +418,10 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
params.referrer = content::Referrer(http_referrer.GetAsReferrer(),
blink::WebReferrerPolicyDefault);
std::string user_agent;
if (options.Get("useragent", &user_agent))
this->SetUserAgent(user_agent);
params.transition_type = ui::PAGE_TRANSITION_TYPED;
params.should_clear_history_list = true;
params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE;