chromium/third_party/blink/public/mojom/choosers/color_chooser.mojom

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

module blink.mojom;

struct ColorSuggestion {
  uint32 color;
  string label;
};

// A ColorChooser window is shown for <input type="color">.
interface ColorChooserFactory {
  // OpenColorChooser opens a platform specific color chooser in the browser.
  // Enabled on platfoms that opt in using the "is_using_open_color_chooser"
  // enabled_features option.
  [EnableIf=is_using_open_color_chooser]
  OpenColorChooser(
      pending_receiver<ColorChooser> chooser,
      pending_remote<ColorChooserClient> client,
      uint32 color,
      array<ColorSuggestion> suggestions);
};

interface ColorChooser {
  // Notifies browser of the selected color.
  SetSelectedColor(uint32 color);
};

interface ColorChooserClient {
  // Notifies the renderer that the user selected a color.
  DidChooseColor(uint32 color);
};

// Interface exposed by the browser to the renderer.
interface EyeDropperChooser {
  // EyeDropper window is shown.
  Choose() => (bool success, uint32 color);
};