chromium/ash/webui/personalization_app/proto/backdrop_wallpaper.proto

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Protocol buffer messages to get wallpaper info from the Backdrop service,
// including the wallpaper collection names, image url and descriptions etc.

syntax = "proto2";

package backdrop;

option optimize_for = LITE_RUNTIME;

// Information about the creator or owner of an image.
message Attribution {
  // A localized description of the attribution of an image e.g.
  // "Photo by John Doe" or "Geschrieben von John".
  optional string text = 1;
}

message Image {
  // A unique ID for the image. Useful for analytics.
  optional fixed64 asset_id = 1;

  // The image URL. May be wrapped or modified to include cropping, etc.
  optional string image_url = 2;

  // A URL that can be accessed to find out more information about the image.
  // For example, a link to more information about an artist or photographer or
  // to a Google+ post.
  optional string action_url = 3;

  // An attribution list for the image.
  repeated Attribution attribution = 4;

  // The unit this image belongs to. The unit can be the collection of
  // dark/light theme for the same wallpaper.
  optional fixed64 unit_id = 6;

  enum ImageType {
    IMAGE_TYPE_UNKNOWN = 0;
    IMAGE_TYPE_LIGHT_MODE = 1;
    IMAGE_TYPE_DARK_MODE = 2;
    IMAGE_TYPE_PREVIEW_MODE = 3;
    IMAGE_TYPE_MORNING_MODE = 4;
    IMAGE_TYPE_LATE_AFTERNOON_MODE = 5;
  }

  // The type of this image in the unit.
  optional ImageType image_type = 7;

  // User facing description text about this image e.g.
  // "[Artist name] was inspired to create this by [inspiring thing]."
  // May be multi-line.
  optional string description_content = 8;

  // User facing description title about this image e.g.
  // "Art by [Artist Name]"
  optional string description_title = 9;
}

// A logical grouping of images e.g. landscapes or space photography.
message Collection {
  // The unique id for the collection.
  optional string collection_id = 1;

  // A localized name of the collection e.g. "Landscapes" or "Kunst".
  optional string collection_name = 2;

  // A list of representative images for the collection. Currently only a single
  // image will be returned.
  repeated Image preview = 3;

  // User-facing supplemental description of the collection e.g.
  // "Celebrate [Holiday] with Google".
  optional string description_content = 4;
}

message GetCollectionsRequest {
  // The language that should be used for content.
  optional string language = 1;

  // The approximate permanent location of the user e.g. "us".
  optional string region = 2;

  // An string describes a label (e.g. NEXUS, etc) used to return exclusive
  // content or filter unwanted collections from the corpus.
  repeated string filtering_label = 3;
}

message GetCollectionsResponse {
  // A list of every available collection for the given language and region.
  repeated Collection collections = 1;
}

// Next Id: 5
message GetImagesInCollectionRequest {
  // The id of the collection being requested.
  optional string collection_id = 1;

  // The language that should be used for content.
  optional string language = 2;

  // The approximate permanent location of the user e.g. "us".
  optional string region = 3;

  // An string describes a label (e.g. NEXUS, etc) used to return exclusive
  // content or filter unwanted images from the corpus.
  repeated string filtering_label = 4;
}

message GetImagesInCollectionResponse {
  // A list of all the images in a collection, filtered by language and region.
  repeated Image images = 1;
}

// Next Id: 6
message GetImageFromCollectionRequest {
  // The collections that the image will be selected from.
  repeated string collection_ids = 1;

  // An opaque token, copied from GetImageFromCollectionResponse, that is used
  // to prevent duplicate images from being returned.
  optional string resume_token = 2;

  // The language that should be used for content.
  optional string language = 3;

  // The approximate permanent location of the user e.g. "us".
  optional string region = 4;

  // An string describes a label (e.g. NEXUS, etc) used to return exclusive
  // content or filter unwanted images from the corpus.
  repeated string filtering_label = 5;
}

message GetImageFromCollectionResponse {
  // The imaged selected from the given collections.
  optional Image image = 1;

  // An opaque token that should be passed in subsequent calls and is used to
  // prevent duplicate images from being returned.
  optional string resume_token = 2;
}