Commit 4c24ab18 authored by Xing Liu's avatar Xing Liu Committed by Commit Bot

Notification: Add notification proto.

This CL adds a proto to serialize dynamically generated data to schedule
a notification and display later.

Bug: 930968
Change-Id: Iadd7ca8f820097db2dee47d664ddbf0ca4528cbf
Reviewed-on: https://chromium-review.googlesource.com/c/1468341
Commit-Queue: Xing Liu <xingliu@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635812}
parent cef1ef86
......@@ -1826,6 +1826,7 @@ jumbo_split_static_library("browser") {
"//chrome/browser/metrics:expired_histograms_array",
"//chrome/browser/metrics/variations:chrome_ui_string_overrider_factory",
"//chrome/browser/net:probe_message_proto",
"//chrome/browser/notifications",
"//chrome/browser/profiling_host",
"//chrome/browser/push_messaging:budget_proto",
"//chrome/browser/resource_coordinator:mojo_bindings",
......
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
group("notifications") {
deps = [
"//chrome/browser/notifications/proto",
]
}
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//third_party/protobuf/proto_library.gni")
proto_library("proto") {
sources = [
"icon.proto",
"notification_data.proto",
]
}
dtrainor@chromium.org
peter@chromium.org
xingliu@chromium.org
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package notifications;
// Stores the icon used in a notification. The icon is in PNG format. Each time
// we should only load one icon asynchronously into memory.
// Next tag: 3
message Icon {
// Unique identifier of the icon. Serves as the key to load the icon proto
// from database.
optional string uuid = 1;
// Raw data of the icon to show in the notification in PNG format.
optional bytes icon = 2;
}
\ No newline at end of file
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package notifications;
// Stores a scheduled notification which will be displayed in the future.
// Next tag: 6
// TODO(xingliu): Add other fields if necessary.
message NotificationData {
// Identifier of the notification.
optional string id = 1;
// Title of the notification.
optional string title = 2;
// Body text of the notification.
optional string message = 3;
// The unique identifier of the icon of the notification. Each time we should
// only load one icon asynchronously into memory with the uuid.
optional string icon_uuid = 4;
// URL of the web site responsible for showing the notification.
optional string url = 5;
}
\ No newline at end of file
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