Commit 0f693cbc authored by Vincent Boisselle's avatar Vincent Boisselle Committed by Commit Bot

Populate the action surface field in the feed action proto

Bug: 1126510
Change-Id: I7ca19081e54aaee7d6c4116a0773fda2da14efe8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2401701
Commit-Queue: Vincent Boisselle <vincb@google.com>
Reviewed-by: default avatarDan H <harringtond@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805470}
parent 4fcdb087
...@@ -33,6 +33,28 @@ message FeedAction { ...@@ -33,6 +33,28 @@ message FeedAction {
// The duration for the action in milliseconds. In case of view actions this // The duration for the action in milliseconds. In case of view actions this
// is the duration for which the content is considered "viewed". // is the duration for which the content is considered "viewed".
optional int64 duration_ms = 3; optional int64 duration_ms = 3;
enum ActionOrigin {
UNKNOWN_ORIGIN = 0;
// Action generated from the current session on the client.
CLIENT_SESSION = 1;
// Action was previously cached on the client.
CLIENT_CACHE = 2;
}
// Where the action came from on the client.
// Optional: This field is purely for diagnostics.
optional ActionOrigin action_origin = 4;
// The surface an action was taken on.
enum ActionSurface {
UNKNOWN_SURFACE = 0;
ANDROID_CHROME_NEW_TAB = 7;
IOS_CHROME_NEW_TAB = 8;
}
// What surface the action came from.
optional ActionSurface action_surface = 5;
} }
reserved 4, 5, 6; reserved 4, 5, 6;
} }
...@@ -111,8 +111,11 @@ UploadActionsTask::UploadActionsTask( ...@@ -111,8 +111,11 @@ UploadActionsTask::UploadActionsTask(
upload_now_(upload_now), upload_now_(upload_now),
wire_action_(std::move(action)), wire_action_(std::move(action)),
callback_(std::move(callback)) { callback_(std::move(callback)) {
wire_action_->mutable_client_data()->set_timestamp_seconds( auto* client_data = wire_action_->mutable_client_data();
client_data->set_timestamp_seconds(
(base::Time::Now() - base::Time::UnixEpoch()).InSeconds()); (base::Time::Now() - base::Time::UnixEpoch()).InSeconds());
client_data->set_action_surface(
feedwire::FeedAction::ClientData::ANDROID_CHROME_NEW_TAB);
} }
UploadActionsTask::UploadActionsTask( UploadActionsTask::UploadActionsTask(
......
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