[go: nahoru, domu]

blob: 23763e1029ab848d12c3fd05d9c14aa700837c57 [file] [log] [blame]
// Copyright 2017 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 chrome.mojom;
import "chrome/common/web_page_metadata.mojom";
import "mojo/public/mojom/base/string16.mojom";
import "third_party/blink/public/mojom/window_features/window_features.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
import "url/mojom/url.mojom";
enum ImageFormat {
JPEG,
PNG,
// ORIGINAL means request basic image formats, JPG/PNG/GIF, if the original
// image format is not one of them, encode the image to JPG and return.
ORIGINAL,
};
// Messages sent from chrome to the render frame.
interface ChromeRenderFrame {
// Updates the window features of the main frame's render view.
SetWindowFeatures(blink.mojom.WindowFeatures window_features);
// Reloads the image selected by the most recently opened context menu
// (if there indeed is an image at that location).
RequestReloadImageForContextNode();
// Requests an encoded image selected by the most recently opened context
// menu. The encoding format is specified as a parameter. If no image is
// selected or there's an error capturing the image, |image_data| will be
// empty. If the image area is larger than |image_min_area_pixels| it will be
// downscaled to fit within |image_max_size_pixels|.
// If |image_format| is ORIGINAL, return orinal image data except image
// larger than size specified as a parameter. In that case, returns a resized
// JPEG static image.
RequestImageForContextNode(int32 image_min_area_pixels,
gfx.mojom.Size image_max_size_pixels,
ImageFormat image_format)
=> (array<uint8> image_data, gfx.mojom.Size original_size,
string encoded_extension);
// For WebUI testing, this message requests JavaScript to be executed at a
// time which is late enough to not be thrown out, and early enough to be
// before onload events are fired.
ExecuteWebUIJavaScript(mojo_base.mojom.String16 javascript);
// Requests the web page metadata from the renderer.
GetWebPageMetadata() => (WebPageMetadata web_page_metadata);
// Sets a header identifying the CCT session.
[EnableIf=is_android]
SetCCTClientHeader(string header);
// Requests the Media Feed Url from the renderer (if the page has one).
GetMediaFeedURL() => (url.mojom.Url? url);
// Tells the render frame to load any blocked plugins matching the given
// identifier (empty string matches all).
LoadBlockedPlugins(string identifier);
};