Commit 1fa935bd authored by vandebo@chromium.org's avatar vandebo@chromium.org

Update media galleries documentation.

BUG=116025
NOTRY=TRUE

Review URL: https://chromiumcodereview.appspot.com/10832079

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149139 0039d316-1c4b-4281-b951-d872f2087c98
parent 8e2278ee
......@@ -17,8 +17,11 @@ namespace mediaGalleries {
};
[inline_doc] dictionary MediaFileSystemsDetails {
// Whether to prompt the user for additional media galleries before
// returning the permitted set. Default is silent.
// Whether to prompt the user for permission to additional media galleries
// before returning the permitted set. Default is silent. If the value
// 'yes' is passed, or if the application has not been granted access to
// any media galleries and the value 'if_needed' is passed, then the
// media gallery configuration dialog will be displayed.
GetMediaFileSystemsInteractivity? interactive;
};
......
......@@ -17,8 +17,9 @@
<script type="text/javascript" src="../js/api_page_generator.js"></script>
<script type="text/javascript" src="../js/bootstrap.js"></script>
<script type="text/javascript" src="../js/sidebar.js"></script>
<meta name="description" content="Documentation for the chrome.experimental.mediaGalleries module, which is part of the Google Chrome extension APIs."><title>chrome.experimental.mediaGalleries - Google Chrome Extensions - Google Code</title></head>
<body doc-family="extensions"> <link href="../css/ApiRefStyles.css" rel="stylesheet" type="text/css">
<meta name="description" content="Documentation for the chrome.mediaGalleries module, which is part of the Google Chrome extension APIs."><title>Media Galleries - Google Chrome Extensions - Google Code</title></head>
<body doc-family="apps"> <link href="../css/ApiRefStyles_apps.css" rel="stylesheet" type="text/css">
<link href="../css/prettify.css" rel="stylesheet" type="text/css">
<link href="../css/shared.css" rel="stylesheet" type="text/css">
<div id="devModeWarning" class="displayModeWarning">
You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files.
......@@ -53,16 +54,18 @@
<!-- API HEADER -->
<table id="header" width="100%" cellspacing="0" border="0">
<tbody><tr>
<td valign="middle"><a href="http://code.google.com/"><img src="../images/code_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:0; margin:0;"></a></td>
<td valign="middle"><a href="http://code.google.com/"><img src="../images/chrome_logo.gif" alt="Google Code" style="border:0; margin:0;"></a></td>
<td valign="middle" width="100%" style="padding-left:0.6em;">
<form action="http://www.google.com/cse" id="cse" style="margin-top:0.5em">
<div id="gsc-search-box">
<input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno">
<input type="hidden" name="ie" value="UTF-8">
<input type="text" name="q" value="" size="55">
<input class="gsc-search-button" type="submit" name="sa" value="Search">
<input id="gsc-search-input" type="text" name="q" value="" size="55">
<button class="gsc-search-button" type="submit" name="sa">
<img class="gsc-search-button-lens" src="../images/search.png" alt="Search">
</button>
<br>
<span class="greytext">e.g. "page action" or "tabs"</span>
<span class="greytext">e.g. "event page" or "alarms"</span>
</div>
</form>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
......@@ -75,25 +78,22 @@
<div id="codesiteContent" class="">
<a id="gc-topnav-anchor"></a>
<div id="gc-topnav">
<h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Labs</a>)</h1>
<h1>Packaged Apps</h1>
<ul id="home" class="gc-topnav-tabs">
<li id="home_link">
<a href="index.html" title="Google Chrome Extensions home page">Home</a>
<a href="about_apps.html" title="Packaged Apps home page"><span>Home</span></a>
</li>
<li id="docs_link">
<a href="docs.html" title="Official Google Chrome Extensions documentation">Docs</a>
</li>
<li id="faq_link">
<a href="faq.html" title="Answers to frequently asked questions about Google Chrome Extensions">FAQ</a>
<a href="develop_apps.html" title="Packaged apps developer documentation"><span>Docs</span></a>
</li>
<li id="samples_link">
<a href="samples.html" title="Sample extensions (with source code)">Samples</a>
<a href="https://github.com/GoogleChrome/chrome-app-samples" title="Packaged apps samples repository"><span>Samples</span></a>
</li>
<li id="group_link">
<a href="http://groups.google.com/a/chromium.org/group/chromium-extensions" title="Google Chrome Extensions developer forum">Group</a>
<a href="http://groups.google.com/a/chromium.org/group/chromium-apps" title="Google Chrome Apps developer forum"><span>Group</span></a>
</li>
<li id="so_link">
<a href="http://stackoverflow.com/questions/tagged/google-chrome-extension" title="[google-chrome-extension] tag on Stack Overflow">Questions?</a>
<a href="http://stackoverflow.com/questions/tagged/google-chrome-extension" title="[google-chrome-extension] tag on Stack Overflow"><span>Questions?</span></a>
</li>
</ul>
</div> <!-- end gc-topnav -->
......@@ -101,84 +101,55 @@
<!-- SIDENAV -->
<div class="g-unit g-first" id="gc-toc">
<ul>
<li><a href="getstarted.html">Getting Started</a></li>
<li><a href="overview.html">Overview</a></li>
<li><a href="whats_new.html">What's New?</a></li>
<li><h2><a href="devguide.html">Developer's Guide</a></h2>
<li><h2>Getting Started</h2>
<ul>
<li>Browser UI
<ul>
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
<li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
</ul>
</li>
<li>Browser Interaction
<li><a href="about_apps.html">What Are Packaged Apps?</a></li>
<li><a href="app_architecture.html">Understand the Architecture</a></li>
<li><a href="first_app.html">Create Your First App</a></li>
</ul>
</li>
<li><h2>Developing</h2>
<ul>
<li><a href="develop_apps.html">Before You Start</a></li>
<li><span>The Fundamentals</span>
<ul>
<li><a href="bookmarks.html">Bookmarks</a></li>
<li><a href="cookies.html">Cookies</a></li>
<li><a href="devtools.html">Developer Tools</a></li>
<li><a href="events.html">Events</a></li>
<li><a href="history.html">History</a></li>
<li><a href="management.html">Management</a></li>
<li><a href="tabs.html">Tabs</a></li>
<li><a href="windows.html">Windows</a></li>
<li><a href="app_lifecycle.html">Manage App Lifecycle</a></li>
<li><a href="app_storage.html">Manage Data</a></li>
<li><a href="offline_apps.html">Offline First</a></li>
<li><a href="app_external.html">Embed Content</a></li>
</ul>
</li>
<li>Implementation
<li><span>Security &amp; Privacy</span>
<ul>
<li><a href="a11y.html">Accessibility</a></li>
<li><a href="background_pages.html">Background Pages</a></li>
<li><a href="content_scripts.html">Content Scripts</a></li>
<li><a href="xhr.html">Cross-Origin XHR</a></li>
<li><a href="i18n.html">Internationalization</a></li>
<li><a href="messaging.html">Message Passing</a></li>
<li><a href="permissions.html">Optional Permissions</a></li>
<li><a href="npapi.html">NPAPI Plugins</a></li>
<li><a href="app_identity.html">Identify User</a></li>
<li><a href="app_csp.html">Comply with CSP</a></li>
</ul>
</li>
<li>Finishing
<li><span>Advanced Technologies</span>
<ul>
<li><a href="hosting.html">Hosting</a></li>
<li><a href="external_extensions.html">Other Deployment Options</a></li>
<li><a href="app_network.html">Network Communications</a></li>
<li><a href="app_hardware.html">Access Hardware Devices</a></li>
<li><a href="app_intents.html">Connect Apps with Web Intents</a></li>
</ul>
</li>
<li><a href="app_frameworks.html">MVC Architecture</a></li>
</ul>
</li>
<li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<li><h2>Deploying</h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
<li><a href="tut_analytics.html">Google Analytics</a></li>
<li><a href="tut_oauth.html">OAuth</a></li>
<li><a href="publish_app.html">Publish</a></li>
</ul>
</li>
<li><h2>Reference</h2>
<ul>
<li>Formats
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
</ul>
</li>
<li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
</li>
<li><h2><a href="samples.html">Samples</a></h2></li>
<div class="line"> </div>
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
<li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="api_index.html">Chrome JavaScript APIs</a></li>
<li><a href="api_other.html">Supported Libraries</a></li>
<li><a href="app_deprecated.html">Disabled Web Features</a></li>
</ul>
</li>
<li><h2><a href="https://github.com/GoogleChrome/chrome-app-samples">Samples</a></h2></li>
<li><h2><a href="app_known_issues.html">Known Issues</a></h2></li>
</ul>
</div>
<script>
......@@ -186,22 +157,25 @@
</script>
<div class="g-unit" id="gc-pagecontent">
<div id="pageTitle">
<h1 class="page_title">chrome.experimental.mediaGalleries</h1>
<h1 class="page_title">Media Galleries</h1>
</div>
<!-- TABLE OF CONTENTS -->
<div id="toc">
<h2>Contents</h2>
<ol>
<li>
<a href="#manifest">Manifest</a>
<ol>
</ol>
</li>
<li>
<a href="#apiReference">API reference: chrome.experimental.mediaGalleries</a>
<a href="#apiReference">API reference: chrome.mediaGalleries</a>
<ol>
<li>
<a href="#global-methods">Methods</a>
<ol>
<li>
<a href="#method-assembleMediaFile">assembleMediaFile</a>
</li><li>
<a href="#method-extractEmbeddedThumbnails">extractEmbeddedThumbnails</a>
<a href="#method-getMediaFileSystems">getMediaFileSystems</a>
</li>
</ol>
</li>
......@@ -211,15 +185,37 @@
</div>
<!-- /TABLE OF CONTENTS -->
<!-- Standard content lead-in for experimental API pages -->
<p id="classSummary">
For information on how to use experimental APIs, see the <a href="experimental.html">chrome.experimental.* APIs</a> page.
</p>
<!-- STATIC CONTENT PLACEHOLDER -->
<div id="static"></div>
<div id="static"><div id="pageData-name" class="pageData">Media Galleries</div>
<!-- BEGIN AUTHORED CONTENT -->
<p>
The media galleries API allows you to access media files (images,
video, audio) from the user's local disks (with the user's consent).
</p>
<p>
Using the API, you can prompt the user for permission to access the media
galleries. The permission dialog will contain common media locations for
the platform and will allow the user to add additional locations. From those
locations, only media files will be present in the file system objects.
</p>
<h2 id="manifest">Manifest</h2>
<p>You must declare the type of access to the media gallery you require
in your extension's manifest to use the API. Currently only the
"mediaGalleriesRead" permission is allowed. This permission does not
currently trigger an install time permission prompt because it requires
the user to grant permission at runtime.</p>
<p>
You may also specify the "mediaGalleriesAllGalleries" permission to get
access to all auto-detected media galleries on the user's computer. This
permission displays an install time prompt indicating that the extension
will have access to all of the user's media files.
</p>
<!-- END AUTHORED CONTENT -->
</div>
<!-- API PAGE -->
<div class="apiPage">
<a name="apiReference"></a>
<h2>API reference: chrome.experimental.mediaGalleries</h2>
<h2>API reference: chrome.mediaGalleries</h2>
<!-- PROPERTIES -->
<!-- /apiGroup -->
<!-- METHODS -->
......@@ -228,69 +224,79 @@
<h3>Methods</h3>
<!-- iterates over all functions -->
<div class="apiItem">
<a name="method-assembleMediaFile"></a> <!-- method-anchor -->
<h4>assembleMediaFile</h4>
<a name="method-getMediaFileSystems"></a> <!-- method-anchor -->
<h4>getMediaFileSystems</h4>
<div class="summary">
<!-- Note: intentionally longer 80 columns -->
<span>chrome.experimental.mediaGalleries.assembleMediaFile</span>(<span class="null"><span>Blob</span>
<var><span>mediaFileContents</span></var></span><span class="null"><span>, </span><span>object</span>
<var><span>metadata</span></var></span><span class="null"><span>, </span><span>function</span>
<var><span>AssembleMediaFileCallback</span></var></span>)</div>
<span>chrome.mediaGalleries.getMediaFileSystems</span>(<span class="optional"><span>object</span>
<var><span>details</span></var></span><span class="null"><span>, </span><span>function</span>
<var><span>MediaFileSystemsCallback</span></var></span>)</div>
<div class="description">
<p>Create a new MediaFile setting the metadata in the Blob to the supplied values, overriding any existing metadata in the media file. If user agent does not recognize the Blob as a supported file format, it will fail.</p>
<p>Get the media galleries configured in this user agent. If none are configured or available, the callback will receive an empty array.</p>
<!-- PARAMETERS -->
<h4>Parameters</h4>
<dl>
<div>
<div>
<dt>
<var>mediaFileContents</var>
<var>details</var>
<em>
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
<span id="typeTemplate">
<span>
<span>Blob</span>
<span>object</span>
</span>
</span>
)
</div>
</em>
</dt>
<dd>the media bytes.</dd>
<dd class="todo">
Undocumented.
</dd>
<!-- OBJECT PROPERTIES -->
<!-- OBJECT METHODS -->
<!-- OBJECT EVENT FIELDS -->
<!-- FUNCTION PARAMETERS -->
</div>
</div><div>
<div>
<dd>
<dl>
<div>
<div>
<dt>
<var>metadata</var>
<var>interactive</var>
<em>
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
<span class="enum">enumerated</span>
<span id="typeTemplate">
<span>
<span>object</span>
<span>string</span>
<span>["no", "yes", "if_needed"]</span>
</span>
</span>
)
</div>
</em>
</dt>
<dd>the metadata. TODO(estade): this should be [instanceOf=Metafile].</dd>
<dd>Whether to prompt the user for permission to additional media galleries before returning the permitted set. Default is silent. If the value 'yes' is passed, or if the application has not been granted access to any media galleries and the value 'if_needed' is passed, then the media gallery configuration dialog will be displayed.</dd>
<!-- OBJECT PROPERTIES -->
<!-- OBJECT METHODS -->
<!-- OBJECT EVENT FIELDS -->
<!-- FUNCTION PARAMETERS -->
</div>
</div>
</dl>
</dd>
<!-- OBJECT METHODS -->
<!-- OBJECT EVENT FIELDS -->
<!-- FUNCTION PARAMETERS -->
</div>
</div><div>
<div>
<dt>
<var>AssembleMediaFileCallback</var>
<var>MediaFileSystemsCallback</var>
<em>
<!-- TYPE -->
<div style="display:inline">
......@@ -318,7 +324,7 @@
<div>
<div>
<dt>
<var>mediaFile</var>
<var>mediaFileSystems</var>
<em>
<!-- TYPE -->
<div style="display:inline">
......@@ -326,7 +332,13 @@
<span class="optional">optional</span>
<span id="typeTemplate">
<span>
<span>Blob</span>
<span>
array of <span><span>
<span>
<span>LocalFileSystem</span>
</span>
</span></span>
</span>
</span>
</span>
)
......@@ -345,91 +357,6 @@
</dl>
</div>
</dd>
</div>
</div>
</dl>
<!-- RETURNS -->
<dl>
</dl>
<!-- CALLBACK -->
<div>
<div>
<h4>Callback function</h4>
<p>
The <em>callback</em> parameter should specify a function
that looks like this:
</p>
<!-- Note: intentionally longer 80 columns -->
<pre>function(<span>Blob mediaFile</span>) <span class="subdued">{...}</span>;</pre>
<dl>
<div>
<div>
<dt>
<var>mediaFile</var>
<em>
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
<span id="typeTemplate">
<span>
<span>Blob</span>
</span>
</span>
)
</div>
</em>
</dt>
<dd class="todo">
Undocumented.
</dd>
<!-- OBJECT PROPERTIES -->
<!-- OBJECT METHODS -->
<!-- OBJECT EVENT FIELDS -->
<!-- FUNCTION PARAMETERS -->
</div>
</div>
</dl>
</div>
</div>
<!-- MIN_VERSION -->
</div> <!-- /description -->
</div><div class="apiItem">
<a name="method-extractEmbeddedThumbnails"></a> <!-- method-anchor -->
<h4>extractEmbeddedThumbnails</h4>
<div class="summary">
<!-- Note: intentionally longer 80 columns -->
<span>chrome.experimental.mediaGalleries.extractEmbeddedThumbnails</span>(<span class="null"><span>object</span>
<var><span>mediaFile</span></var></span>)</div>
<div class="description">
<p>Get any thumbnails contained in the passed media file. The resulting directory reader refers to a virtual directory that can not be navigated to. If there are no thumbnails in the passed file entry, the virtual directory will have no entries. TODO(estade): The return type should be Directory. The argument type should be [instanceOf=FileEntry].</p>
<!-- PARAMETERS -->
<h4>Parameters</h4>
<dl>
<div>
<div>
<dt>
<var>mediaFile</var>
<em>
<!-- TYPE -->
<div style="display:inline">
(
<span id="typeTemplate">
<span>
<span>object</span>
</span>
</span>
)
</div>
</em>
</dt>
<dd class="todo">
Undocumented.
</dd>
<!-- OBJECT PROPERTIES -->
<!-- OBJECT METHODS -->
<!-- OBJECT EVENT FIELDS -->
<!-- FUNCTION PARAMETERS -->
</div>
</div>
</dl>
......@@ -458,11 +385,20 @@
<a rel="license" href="http://code.google.com/google_bsd_license.html">BSD License</a>.
</p>
<p>
©2011 Google
©2012 Google
</p>
<!-- begin analytics -->
<script src="https://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script src="https://www.google-analytics.com/ga.js" type="text/javascript"></script>
<script src="../js/prettify.js" type="text/javascript"></script>
<script>
// Auto syntax highlight all pre tags.
var pres = document.querySelectorAll('pre');
for (var i = 0, pre; pre = pres[i]; ++i) {
pre.className += ' prettyprint';
};
prettyPrint();
</script>
<script type="text/javascript">
// chrome doc tracking
try {
......
<div id="pageData-name" class="pageData">Media Galleries</div>
<!-- BEGIN AUTHORED CONTENT -->
<p>
The media galleries API allows you to access media files (images,
video, audio) from the user's local disks (with the user's consent).
</p>
<p>
Using the API, you can prompt the user for permission to access the media
galleries. The permission dialog will contain common media locations for
the platform and will allow the user to add additional locations. From those
locations, only media files will be present in the file system objects.
</P>
<h2 id="manifest">Manifest</h2>
<p>You must declare the type of access to the media gallery you require
in your extension's manifest to use the API. Currently only the
"mediaGalleriesRead" permission is allowed. This permission does not
currently trigger an install time permission prompt because it requires
the user to grant permission at runtime.</p>
<p>
You may also specify the "mediaGalleriesAllGalleries" permission to get
access to all auto-detected media galleries on the user's computer. This
permission displays an install time prompt indicating that the extension
will have access to all of the user's media files.
</p>
<!-- END AUTHORED CONTENT -->
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