Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3408)

Unified Diff: chrome/common/extensions/docs/examples/api/storage/stylizr/options.js

Issue 9691033: Update the Stylizr example to work with the manifest changes the Storage API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/examples/api/storage/stylizr/options.js
diff --git a/chrome/common/extensions/docs/examples/api/storage/stylizr/options.js b/chrome/common/extensions/docs/examples/api/storage/stylizr/options.js
index 82fa04f23b2d18c56ce5bd43994ff08adf616a3d..0832551357107930cb5c58ae693f1d7211aa55eb 100644
--- a/chrome/common/extensions/docs/examples/api/storage/stylizr/options.js
+++ b/chrome/common/extensions/docs/examples/api/storage/stylizr/options.js
@@ -33,6 +33,8 @@ function saveChanges() {
function loadChanges() {
storage.get('css', function(items) {
+ // To avoid checking items.css we could specify storage.get({css: ''}) to
+ // return a default value of '' if there is no css value yet.
if (items.css) {
textarea.value = items.css;
message('Loaded saved CSS.');
@@ -41,7 +43,8 @@ function loadChanges() {
}
function reset() {
- // Remove the saved value from storage
+ // Remove the saved value from storage. storage.clear would achieve the same
+ // thing.
storage.remove('css', function(items) {
message('Reset stored CSS');
});
« no previous file with comments | « chrome/common/extensions/docs/examples/api/storage/stylizr/manifest.json ('k') | chrome/common/extensions/docs/samples.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698