diff options
Diffstat (limited to 'chrome/common/extensions/docs/reference/bookmarks_overview.html')
-rwxr-xr-x | chrome/common/extensions/docs/reference/bookmarks_overview.html | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/chrome/common/extensions/docs/reference/bookmarks_overview.html b/chrome/common/extensions/docs/reference/bookmarks_overview.html new file mode 100755 index 0000000..b93be64 --- /dev/null +++ b/chrome/common/extensions/docs/reference/bookmarks_overview.html @@ -0,0 +1,121 @@ +<!-- BEGIN AUTHORED CONTENT -->
+<p id="classSummary">
+Use the <code>chrome.bookmarks</code> API to create, organize, and otherwise manipulate bookmarks.
+</p>
+
+<h2 id="description">Description</h2>
+
+<p>
+[PENDING: intro goes here...]
+</p>
+
+<p>
+<em>Bookmark objects</em> are an important part of the <code>chrome.bookmarks</code> API.
+Each bookmark object represents either a URL or a group of bookmarks, as you can see in the following figure.
+</p>
+
+<img
+ alt="2 kinds of bookmark objects"
+ width="415"
+ height="123"
+ src="https://sites.google.com/a/google.com/kathys-drafts/Chrome/chrome-extensions-drafts/api-mock-doc/chrome-bookmarks-final-mock/bookmarks.png"></a>
+
+
+<h3 id="overview-properties">Properties</h3>
+
+<p>Objects that represent bookmarks can have the following properties:
+</p>
+
+<dl>
+<dt> <code>id</code> </dt>
+<dd> An integer ID that's unique for each bookmark.
+ Don't save this ID in persistent storage;
+ the ID for a particular bookmark might change the next time the browser is started.
+ </dd>
+
+<dt> <code>title</code> </dt>
+<dd> The name of the bookmark.
+ This is the user-visible string that describes the URL or group.
+ </dd>
+
+<dt> <code>parentId </code>
+ <em>(omitted for the root group)</em>
+ </dt>
+<dd> The ID of the group that this bookmark is in. </dd>
+
+<dt> <code>index</code>
+ <em>(optional; omitted for the root group)</em>
+ </dt>
+<dd> The 0-based integer position of the bookmark within its group. </dd>
+
+<dt> <code>url</code>
+ <em>(omitted for groups)</em>
+ </dt>
+<dd> The URL of the page that the bookmark points to. </dd>
+</dl>
+
+<h3 id="overview-examples">Examples</h3>
+
+<p>
+The following code creates a bookmark group with the title "Chromium bookmarks".
+The last argument defines a function to be executed after the folder is created.
+</p>
+
+<pre>
+chrome.bookmarks.create({'parentId': bookmarkBar.id,
+ 'title': 'Chromium bookmarks'},
+ function(newFolder) {...});
+</pre>
+
+<p>
+The next snippet creates a bookmark pointing to the Chromium developer doc.
+Since nothing too bad will happen if creating the bookmark fails,
+this snippet doesn't bother to define a callback function.
+</p>
+
+<pre>
+chrome.bookmarks.create({'parentId': chromiumBookmarks.id,
+ 'title': 'dev doc',
+ 'url': 'http://dev.chromium.org'});
+</pre>
+
+<p>
+Say you have bookmark hierarchy that looks like this:</p>
+
+<ul>
+ <li>Bookmarks</li>
+ <ul>
+ <li>Google</li>
+ <ul>
+ <li>Apps</li>
+ <ul>
+ <li>...</li>
+ <li>...</li>
+ <li>...</li>
+ </ul>
+ <li>Google homepage</li>
+ </ul>
+ <li>Example</li>
+ </ul>
+</ul>
+
+<p>
+Here's how those bookmarks might be represented with bookmark objects:</p>
+
+<img
+ alt="a hierarchy of bookmarks"
+ src="https://sites.google.com/a/google.com/kathys-drafts/Chrome/chrome-extensions-drafts/api-mock-doc/chrome-bookmarks-final-mock/bookmark-hierarchy.png">
+
+<p>
+Here's some code you could use to create that hierarchy:</p>
+
+<pre class="example">
+...code goes here...
+</pre>
+
+
+<div class="exampleLink">
+<a href="http://www.google.com/url?q=http%3A%2F%2Fexample.com&sa=D&sntz=1&usg=AFrqEzd0oeJ1qGwYPoKuq1dTesEchMDLIQ">Full source code</a> |
+<a href="http://www.google.com/url?q=http%3A%2F%2Fexample.com&sa=D&sntz=1&usg=AFrqEzd0oeJ1qGwYPoKuq1dTesEchMDLIQ">Install extension</a>
+</div> <!-- END exampleLink -->
+<!-- END AUTHORED CONTENT -->
|