Commit 1e6fe81b authored by Jesse Schettler's avatar Jesse Schettler Committed by Commit Bot

arc: Create print_common.mojom

Create print_common.mojom for common print structs and enums.

Bug: b:138786123
Test: Build Chrome
Change-Id: Ib32f22abef74e1eb85fb529b21705247495c72d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1730625Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Jesse Schettler <jschettler@chromium.org>
Auto-Submit: Jesse Schettler <jschettler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683330}
parent 79acb225
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "chrome/browser/printing/printer_query.h" #include "chrome/browser/printing/printer_query.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "components/arc/arc_browser_context_keyed_service_factory_base.h" #include "components/arc/arc_browser_context_keyed_service_factory_base.h"
#include "components/arc/common/print_common.mojom.h"
#include "components/arc/session/arc_bridge_service.h" #include "components/arc/session/arc_bridge_service.h"
#include "components/keyed_service/core/keyed_service.h" #include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "components/arc/common/print.mojom.h" #include "components/arc/common/print_common.mojom.h"
#include "printing/backend/print_backend.h" #include "printing/backend/print_backend.h"
#include "printing/page_range.h" #include "printing/page_range.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
......
...@@ -47,6 +47,7 @@ if (is_chromeos) { ...@@ -47,6 +47,7 @@ if (is_chromeos) {
"policy.mojom", "policy.mojom",
"power.mojom", "power.mojom",
"print.mojom", "print.mojom",
"print_common.mojom",
"print_spooler.mojom", "print_spooler.mojom",
"process.mojom", "process.mojom",
"property.mojom", "property.mojom",
......
...@@ -6,123 +6,7 @@ ...@@ -6,123 +6,7 @@
module arc.mojom; module arc.mojom;
// android.print.PageRange import "components/arc/common/print_common.mojom";
struct PrintPageRange {
// First page inclusive.
int32 start;
// Last page inclusive.
int32 end;
};
// android.print.PrintAttributes.MediaSize
struct PrintMediaSize {
// Id unique among media sizes.
string id;
// Localized label.
string label;
int32 width_mils;
int32 height_mils;
};
// android.print.PrintAttributes.Resolution
struct PrintResolution {
// Id unique among resolutions.
string id;
// Localized label.
string label;
int32 horizontal_dpi;
int32 vertical_dpi;
};
// android.print.PrintAttributes.Margins
struct PrintMargins {
int32 left_mils;
int32 top_mils;
int32 right_mils;
int32 bottom_mils;
};
// android.print.PrintAttributes.COLOR_MODE_*
[Extensible]
enum PrintColorMode {
MONOCHROME = 1,
COLOR = 2,
};
// android.print.PrintAttributes.DUPLEX_MODE_*
[Extensible]
enum PrintDuplexMode {
NONE = 1,
LONG_EDGE = 2,
SHORT_EDGE = 4,
};
// android.print.PrintDocumentInfo.CONTENT_TYPE_*
[Extensible]
enum PrintContentType {
UNKNOWN = -1,
DOCUMENT = 0,
PHOTO = 1,
};
// android.print.PrintAttributes
struct PrintAttributes {
PrintMediaSize? media_size;
PrintResolution? resolution;
PrintMargins? min_margins;
PrintColorMode color_mode;
PrintDuplexMode duplex_mode;
};
struct PrintJobRequest {
// android.printservice.PrintJob fields:
array<int8> id;
string label;
string? printer_id;
int64 creation_time;
int32 copies;
array<PrintPageRange> pages;
PrintAttributes attributes;
// android.print.PrintDocumentInfo fields:
string document_name;
int32 document_page_count;
PrintContentType content_type;
int64 data_size;
// android.printservice.PrintDocument fields:
handle? data;
};
// android.print.PrinterInfo.STATUS_*
[Extensible]
enum PrinterStatus {
IDLE = 1,
BUSY = 2,
UNAVAILABLE = 3,
};
// android.print.PrinterCapabilitiesInfo
struct PrinterCapabilities {
array<PrintMediaSize> media_sizes;
array<PrintResolution> resolutions;
PrintMargins min_margins;
PrintColorMode color_modes;
PrintDuplexMode duplex_modes;
PrintAttributes defaults;
};
// android.print.PrinterInfo
struct PrinterInfo {
// Id unique among printers.
string id;
// Localized name.
string name;
PrinterStatus status;
// Localized description.
string? description;
// Intent for provider-specific settings.
string? info_intent;
PrinterCapabilities? capabilities;
};
// android.printservice.PrinterDiscoverySession implementation. // android.printservice.PrinterDiscoverySession implementation.
// This is called by container when printing is requested and printer discovery // This is called by container when printing is requested and printer discovery
......
mojom = "//components/arc/common/print.mojom" mojom = "//components/arc/common/print_common.mojom"
public_headers = [ public_headers = [
"//printing/backend/print_backend.h", "//printing/backend/print_backend.h",
"//printing/page_range.h", "//printing/page_range.h",
......
// 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.
module arc.mojom;
// android.print.PageRange
struct PrintPageRange {
// First page inclusive.
int32 start;
// Last page inclusive.
int32 end;
};
// android.print.PrintAttributes.MediaSize
struct PrintMediaSize {
// Id unique among media sizes.
string id;
// Localized label.
string label;
int32 width_mils;
int32 height_mils;
};
// android.print.PrintAttributes.Resolution
struct PrintResolution {
// Id unique among resolutions.
string id;
// Localized label.
string label;
int32 horizontal_dpi;
int32 vertical_dpi;
};
// android.print.PrintAttributes.Margins
struct PrintMargins {
int32 left_mils;
int32 top_mils;
int32 right_mils;
int32 bottom_mils;
};
// android.print.PrintAttributes.COLOR_MODE_*
[Extensible]
enum PrintColorMode {
MONOCHROME = 1,
COLOR = 2,
};
// android.print.PrintAttributes.DUPLEX_MODE_*
[Extensible]
enum PrintDuplexMode {
NONE = 1,
LONG_EDGE = 2,
SHORT_EDGE = 4,
};
// android.print.PrintDocumentInfo.CONTENT_TYPE_*
[Extensible]
enum PrintContentType {
UNKNOWN = -1,
DOCUMENT = 0,
PHOTO = 1,
};
// android.print.PrintAttributes
struct PrintAttributes {
PrintMediaSize? media_size;
PrintResolution? resolution;
PrintMargins? min_margins;
PrintColorMode color_mode;
PrintDuplexMode duplex_mode;
};
struct PrintJobRequest {
// android.printservice.PrintJob fields:
array<int8> id;
string label;
string? printer_id;
int64 creation_time;
int32 copies;
array<PrintPageRange> pages;
PrintAttributes attributes;
// android.print.PrintDocumentInfo fields:
string document_name;
int32 document_page_count;
PrintContentType content_type;
int64 data_size;
// android.printservice.PrintDocument fields:
handle? data;
};
// android.print.PrinterInfo.STATUS_*
[Extensible]
enum PrinterStatus {
IDLE = 1,
BUSY = 2,
UNAVAILABLE = 3,
};
// android.print.PrinterCapabilitiesInfo
struct PrinterCapabilities {
array<PrintMediaSize> media_sizes;
array<PrintResolution> resolutions;
PrintMargins min_margins;
PrintColorMode color_modes;
PrintDuplexMode duplex_modes;
PrintAttributes defaults;
};
// android.print.PrinterInfo
struct PrinterInfo {
// Id unique among printers.
string id;
// Localized name.
string name;
PrinterStatus status;
// Localized description.
string? description;
// Intent for provider-specific settings.
string? info_intent;
PrinterCapabilities? capabilities;
};
...@@ -6,13 +6,15 @@ ...@@ -6,13 +6,15 @@
module arc.mojom; module arc.mojom;
import "components/arc/common/print_common.mojom";
// Next method ID: 0 // Next method ID: 0
interface PrintSpoolerHost { interface PrintSpoolerHost {
// TODO(jschettler): Add methods to open and close print preview // TODO(jschettler): Add methods to open and close Chrome print preview.
}; };
// Next method ID: 1 // Next method ID: 1
interface PrintSpoolerInstance { interface PrintSpoolerInstance {
// Establishes full-duplex communication with the host. // Establishes full-duplex communication with the host.
[MinVersion=0] Init@0(PrintSpoolerHost host_ptr) => (); [MinVersion=0] Init@0(PrintSpoolerHost host_ptr) => ();
}; };
\ 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