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

Unified Diff: chrome/test/data/extensions/api_test/declarative_content/overview/background.js

Issue 11547033: Implement declarativeContent API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 7 years, 11 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/test/data/extensions/api_test/declarative_content/overview/background.js
diff --git a/chrome/test/data/extensions/api_test/declarative_content/overview/background.js b/chrome/test/data/extensions/api_test/declarative_content/overview/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..a23b54653eec856a030fe9698d1c8a4dd5d33914
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/declarative_content/overview/background.js
@@ -0,0 +1,23 @@
+// Copyright (c) 2012 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.
+
+var declarative = chrome.declarative;
+
+var PageStateMatcher = chrome.declarativeContent.PageStateMatcher;
+var ShowPageAction = chrome.declarativeContent.ShowPageAction;
+
+var rule0 = {
+ conditions: [new PageStateMatcher({pageUrl: {hostPrefix: "test1"}}),
+ new PageStateMatcher({css: ["input[type='password']"]})],
+ actions: [new ShowPageAction()]
+}
+
+var testEvent = chrome.declarativeContent.onPageChanged;
+
+testEvent.removeRules(undefined, function() {
+ testEvent.addRules([rule0], function() {
+ chrome.test.sendMessage("ready", function(reply) {
+ })
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698