blob: 8da5467c6995b46ded82c5fa0dab60c22c7bb66b [file] [log] [blame]
// Copyright (c) 2012 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.
//
// Sync protocol datatype extension for enhanced bookmarks.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
option retain_unknown_fields = true;
package sync_pb;
import "bookmark_specifics.proto";
message ChromeSyncFolioInfo {
// Client-generated id. This is opaque to Chrome and unique across all
// EnhancedBookmarkSpecifics for a given user.
optional string folio_id = 1;
// Computed as per enhanced_bookmarks::ItemPosition.
optional string position = 2;
// The size the clip should be displayed in Folio view (i.e. which images
// should be large in hero layout).
enum DisplaySize {
SMALL = 0;
MEDIUM = 1;
};
optional DisplaySize display_size = 3 [default = SMALL];
}
message ChromeSyncImageData {
message ImageInfo {
// The (normalized) URL this image can be found at.
optional string url = 1;
// The dimensions in pixels.
optional int32 width = 2;
optional int32 height = 3;
}
// Information about the original image.
optional ImageInfo original_info = 2;
// Information about the hosted thumbnail.
optional ImageInfo thumbnail_info = 3;
// The expiration timestamp of the served thumbnail, in microseconds since
// the Linux epoch. The thumbnail is only guaranteed until this time,
// afterwards the URL may be broken.
optional int64 expiration_timestamp_us = 4;
}
message ChromeSyncClip {
// Client-generated id. This is opaque to Chrome and unique across all
// EnhancedBookmarkSpecifics for a given user.
optional string id = 1;
optional string note = 2;
repeated ChromeSyncFolioInfo folio_info = 3;
optional string url = 4;
optional string title = 5;
optional string snippet = 6;
optional ChromeSyncImageData image = 7;
// Corresponds to BookmarkNode::date_added() and is the internal value from
// base::Time, in microseconds since the Windows epoch.
optional int64 created_timestamp_us = 8;
// True if url points to a site that may serve malware. Allows warnings to be
// displayed to user.
optional bool is_malware = 9;
// Reasons for failed fetches.
enum FetchErrorReason {
UNKNOWN = 0;
LIKELY_404 = 1;
UNREACHABLE = 2;
}
// Reason that fetching this page failed. This field is populated only if
// the most recent fetch attempt failed.
optional FetchErrorReason fetch_error_reason = 10;
// Bookmark manager or mobile client extension version, for logging and
// debugging purposes.
optional string client_version = 11;
message LegacyBookmarkData {
optional bytes favicon = 1;
optional string icon_url = 2;
}
optional LegacyBookmarkData bookmark_data = 12;
repeated MetaInfo meta_info = 13;
}
message ChromeSyncFolio {
// Client-generated id.
optional string id = 1;
// If set, is the Folio id that corresponds to a Chrome bookmarks folder. As a
// special case, the root folder is assigned an empty string.
optional string parent_id = 2;
optional string title = 3;
optional string description = 4;
optional bool is_public = 5;
// Corresponds to BookmarkNode::date_added() and is the internal value from
// base::Time, in microseconds since the Windows epoch.
optional int64 created_timestamp_us = 6;
// Set if parent_id is set. The position of this folio in its
// parent folio. This is the analog of ChromeSyncFolioInfo.position in clips.
optional string position = 7;
// Bookmark manager or mobile client extension version, for logging and
// debugging purposes.
optional string client_version = 13;
repeated MetaInfo meta_info = 14;
}
// Properties of enhanced bookmark sync objects.
message EnhancedBookmarkSpecifics {
// Exactly one of clip or folio is set.
optional ChromeSyncClip clip = 1;
optional ChromeSyncFolio folio = 2;
}