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

Unified Diff: chrome/common/extensions/docs/examples/extensions/plugin_settings/js/main.js

Issue 8396001: Add sample extension that allows setting plugin-specific content settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 2 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/extensions/plugin_settings/js/main.js
diff --git a/chrome/common/extensions/docs/examples/extensions/plugin_settings/js/main.js b/chrome/common/extensions/docs/examples/extensions/plugin_settings/js/main.js
new file mode 100644
index 0000000000000000000000000000000000000000..1b6156641d700530a874a48359f4680decec1099
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/extensions/plugin_settings/js/main.js
@@ -0,0 +1,16 @@
+// Copyright (c) 2011 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.
+
+document.addEventListener('DOMContentLoaded', function() {
+ chrome.contentSettings.plugins.getResourceIdentifiers(function(r) {
+ if (chrome.extension.lastError) {
+ $('error').textContent =
+ "Error: " + chrome.extension.lastError.message;
+ return;
Mike West 2011/10/25 19:52:06 This means that if the extension ever errors out,
Bernhard Bauer 2011/10/26 13:55:18 I'm not sure there would be much to fix in that ca
+ }
+ var pluginList = $('plugin-list');
+ pluginSettings.ui.PluginList.decorate(pluginList);
+ pluginList.dataModel = new cr.ui.ArrayDataModel(r);
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698