Skip to content

Commit

Permalink
Emit user gesture in headless::Request.
Browse files Browse the repository at this point in the history
Change-Id: Ia8e9d19cede1e02193f4864d2c7fbc27685194b0
Reviewed-on: https://chromium-review.googlesource.com/969750
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544309}
  • Loading branch information
Hidy Han authored and Commit Bot committed Mar 20, 2018
1 parent 19322ce commit 4f3c0e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions headless/public/util/generic_url_request_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions headless/public/util/generic_url_request_job.h
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 4f3c0e7

Please sign in to comment.