15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* Copyright (c) 2012 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/** 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * This file defines the <code>PPP_Instance</code> structure - a series of 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * pointers to methods that you must implement in your module. 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)label Chrome { 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) M14 = 1.0, 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) M17 = 1.1 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}; 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/** 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * The <code>PPP_Instance</code> interface contains pointers to a series of 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * functions that you must implement in your module. These functions can be 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * trivial (simply return the default return value) unless you want your module 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * to handle events such as change of focus or input events (keyboard/mouse) 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * events. 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)interface PPP_Instance { 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /** 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * DidCreate() is a creation handler that is called when a new instance is 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * created. This function is called for each instantiation on the page, 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * corresponding to one \<embed\> tag on the page. 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Generally you would handle this call by initializing the information 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * your module associates with an instance and creating a mapping from the 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * given <code>PP_Instance</code> handle to this data. The 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <code>PP_Instance</code> handle will be used in subsequent calls to 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * identify which instance the call pertains to. 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * It's possible for more than one instance to be created in a single module. 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * This means that you may get more than one <code>OnCreate</code> without an 375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <code>OnDestroy</code> in between, and should be prepared to maintain 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * multiple states associated with each instance. 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * If this function reports a failure (by returning <code>PP_FALSE</code>), 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the instance will be deleted. 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @param[in] instance A new <code>PP_Instance</code> identifying one 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * instance of a module. This is an opaque handle. 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @param[in] argc The number of arguments contained in <code>argn</code> 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * and <code>argv</code>. 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @param[in] argn An array of argument names. These argument names are 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * supplied in the \<embed\> tag, for example: 515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <code>\<embed id="nacl_module" dimensions="2"\></code> will produce two 525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * argument names: "id" and "dimensions." 535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @param[in] argv An array of argument values. These are the values of the 555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * arguments listed in the \<embed\> tag, for example 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <code>\<embed id="nacl_module" dimensions="2"\></code> will produce two 575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * argument values: "nacl_module" and "2". The indices of these values match 585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the indices of the corresponding names in <code>argn</code>. 595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @return <code>PP_TRUE</code> on success or <code>PP_FALSE</code> on 615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * failure. 625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) PP_Bool DidCreate( 645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /* A PP_Instance identifying one instance of a module. */ 655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in] PP_Instance instance, 665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /* The number of arguments contained in argn and argv. */ 675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in] uint32_t argc, 685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /* An array of argument names. These argument names are 695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * supplied in the <embed> tag, for example: 705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <embed id="nacl_module" dimensions="2"> will produce two argument 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * names: "id" and "dimensions." 725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in, size_as=argc] str_t[] argn, 745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /* An array of argument values. These are the values of the 755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * arguments listed in the <embed> tag, for example 765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <embed id="nacl_module" dimensions="2"> will produce two argument 775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * values: "nacl_module" and "2." The indices of these values match the 785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * indices of the corresponding names in argn. 795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in, size_as=argc] str_t[] argv); 815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /** 835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * DidDestroy() is an instance destruction handler. This function is called 845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * in many cases (see below) when a module instance is destroyed. It will be 855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * called even if DidCreate() returned failure. 865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Generally you will handle this call by deallocating the tracking 885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * information and the <code>PP_Instance</code> mapping you created in the 895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * DidCreate() call. You can also free resources associated with this 905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * instance but this isn't required; all resources associated with the deleted 915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * instance will be automatically freed when this function returns. 925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * The instance identifier will still be valid during this call, so the module 945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * can perform cleanup-related tasks. Once this function returns, the 955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <code>PP_Instance</code> handle will be invalid. This means that you can't 965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * do any asynchronous operations like network requests, file writes or 975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * messaging from this function since they will be immediately canceled. 985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <strong>Note:</strong> This function will always be skipped on untrusted 1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * (Native Client) implementations. This function may be skipped on trusted 1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * implementations in certain circumstances when Chrome does "fast shutdown" 1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * of a web page. Fast shutdown will happen in some cases when all module 1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * instances are being deleted, and no cleanup functions will be called. 1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * The module will just be unloaded and the process terminated. 1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @param[in] instance A <code>PP_Instance</code> identifying one instance 1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * of a module. 1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void DidDestroy( 1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /* A PP_Instance identifying one instance of a module. */ 1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in] PP_Instance instance); 1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /** 1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Deprecated in 1.1 in favor of the version that takes a Resource. 1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * DidChangeView() is called when the position, the size, of the clip 1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * rectangle of the element in the browser that corresponds to this 1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * instance has changed. 1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * A typical implementation will check the size of the <code>position</code> 1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * argument and reallocate the graphics context when a different size is 1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * received. Note that this function will be called for scroll events where 1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the size doesn't change, so you should always check that the size is 1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * actually different before doing any reallocations. 1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @param[in] instance A <code>PP_Instance</code> identifying the instance 1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * that has changed. 1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @param[in] position The location on the page of the instance. This is 1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * relative to the top left corner of the viewport, which changes as the 1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * page is scrolled. Generally the size of this value will be used to create 1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * a graphics device, and the position is ignored (most things are relative 1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * to the instance so the absolute position isn't useful in most cases). 1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @param[in] clip The visible region of the instance. This is relative to 1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the top left of the module's coordinate system (not the page). If the 1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * module is invisible, <code>clip</code> will be (0, 0, 0, 0). 1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * It's recommended to check for invisible instances and to stop 1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * generating graphics updates in this case to save system resources. It's 1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * not usually worthwhile, however, to generate partial updates according to 1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the clip when the instance is partially visible. Instead, update the entire 1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * region. The time saved doing partial paints is usually not significant and 1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * it can create artifacts when scrolling (this notification is sent 1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * asynchronously from scrolling so there can be flashes of old content in the 1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * exposed regions). 1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void DidChangeView( 1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /* A PP_Instance identifying the instance whose view changed. */ 1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in] PP_Instance instance, 1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /* The new location on the page of this instance. This is relative to 1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the top left corner of the viewport, which changes as the 1535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * page is scrolled. 1545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in] PP_Rect position, 1565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /* The visible region of the NaCl module. This is relative to the top 1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * left of the plugin's coordinate system (not the page) If the plugin 1585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * is invisible, clip will be (0, 0, 0, 0). 1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in] PP_Rect clip); 1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /** 1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <code>DidChangeView() is called when the position, size, or other view 1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * attributes of the instance has changed. 1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [version=1.1] 1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void DidChangeView( 1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /* A PP_Instance identifying the instance whose view changed. */ 1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in] PP_Instance instance, 1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /** 1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * A handle to a <code>PPB_View</code> resource identifying the new view. 1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in] PP_Resource view); 1745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /** 1765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * DidChangeFocus() is called when an instance has gained or lost focus. 1775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Having focus means that keyboard events will be sent to the instance. 1785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * An instance's default condition is that it will not have focus. 1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 1805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * The focus flag takes into account both browser tab and window focus as 1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * well as focus of the plugin element on the page. In order to be deemed 1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * to have focus, the browser window must be topmost, the tab must be 1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * selected in the window, and the instance must be the focused element on 1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the page. 1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <strong>Note:</strong>Clicks on instances will give focus only if you 1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * handle the click event. Return <code>true</code> from 1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <code>HandleInputEvent</code> in <code>PPP_InputEvent</code> (or use 1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * unfiltered events) to signal that the click event was handled. Otherwise, 1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the browser will bubble the event and give focus to the element on the page 1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * that actually did end up consuming it. If you're not getting focus, check 1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * to make sure you're either requesting them via 1935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <code>RequestInputEvents()<code> (which implicitly marks all input events 1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * as consumed) or via <code>RequestFilteringInputEvents()</code> and 1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * returning true from your event handler. 1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @param[in] instance A <code>PP_Instance</code> identifying the instance 1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * receiving the input event. 1995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @param[in] has_focus Indicates the new focused state of the instance. 2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void DidChangeFocus( 2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /* A PP_Instance identifying one instance of a module. */ 2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in] PP_Instance instance, 2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /* Indicates whether this NaCl module gained or lost event focus. */ 2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in] PP_Bool has_focus); 2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /** 2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * HandleDocumentLoad() is called after initialize for a full-frame 21090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) * instance that was instantiated based on the MIME type of a DOMWindow 2115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * navigation. This situation only applies to modules that are pre-registered 2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * to handle certain MIME types. If you haven't specifically registered to 2135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * handle a MIME type or aren't positive this applies to you, your 2145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * implementation of this function can just return <code>PP_FALSE</code>. 2155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 2165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * The given <code>url_loader</code> corresponds to a 2175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <code>PPB_URLLoader</code> instance that is already opened. Its response 2185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * headers may be queried using <code>PPB_URLLoader::GetResponseInfo</code>. 2195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * The reference count for the URL loader is not incremented automatically on 2205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * behalf of the module. You need to increment the reference count yourself 2215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * if you are going to keep a reference to it. 2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 2235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * This method returns <code>PP_FALSE</code> if the module cannot handle the 2245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * data. In response to this method, the module should call 2255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * ReadResponseBody() to read the incoming data. 2265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 2275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @param[in] instance A <code>PP_Instance</code> identifying the instance 2285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * that should do the load. 2295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 2305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @param[in] url_loader An open <code>PPB_URLLoader</code> instance. 2315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 2325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * @return <code>PP_TRUE</code> if the data was handled, 23390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) * <code>PP_FALSE</code> otherwise. If you return false, the load will be 23490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) * canceled for you. 2355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 2365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) PP_Bool HandleDocumentLoad( 2375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /* A PP_Instance identifying one instance of a module. */ 2385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in] PP_Instance instance, 2395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /* A PP_Resource an open PPB_URLLoader instance. */ 2405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) [in] PP_Resource url_loader); 2415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}; 243