Commit 4f3c0e74 authored by Hidy Han's avatar Hidy Han Committed by Commit Bot

Emit user gesture in headless::Request.

Change-Id: Ia8e9d19cede1e02193f4864d2c7fbc27685194b0
Reviewed-on: https://chromium-review.googlesource.com/969750
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: default avatarAlex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544309}
parent 19322ceb
......@@ -339,6 +339,12 @@ bool GenericURLRequestJob::IsBrowserSideFetch() const {
return request_resource_info_->GetFrameTreeNodeId() != -1;
}
bool GenericURLRequestJob::HasUserGesture() const {
if (!request_resource_info_)
return false;
return request_resource_info_->HasUserGesture();
}
namespace {
void CompletionCallback(int* dest, base::Closure* quit_closure, int value) {
*dest = value;
......
......@@ -87,6 +87,8 @@ class HEADLESS_EXPORT Request {
// Whether or not an asynchronous IPC was used to load this resource.
virtual bool IsAsync() const = 0;
virtual bool HasUserGesture() const = 0;
protected:
Request() {}
virtual ~Request() {}
......@@ -165,6 +167,7 @@ class HEADLESS_EXPORT GenericURLRequestJob
uint64_t GetPostDataSize() const override;
ResourceType GetResourceType() const override;
bool IsAsync() const override;
bool HasUserGesture() const override;
bool IsBrowserSideFetch() const override;
private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment