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

Unified Diff: chrome/test/data/extensions/management/themes/uninstall.js

Issue 6546072: Clean up how we handle themes in the extensions system and management API.... Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 10 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/management/themes/uninstall.js
===================================================================
--- chrome/test/data/extensions/management/themes/uninstall.js (revision 0)
+++ chrome/test/data/extensions/management/themes/uninstall.js (revision 0)
@@ -0,0 +1,23 @@
+// 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.
+
+chrome.management.getAll(function(items) {
+ var theme = null;
+ for (var i = 0; i < items.length; i++) {
+ var item = items[i];
+ if (item.isTheme && item.enabled) {
+ if (theme) {
+ console.log("more than 1 enabled theme!");
+ return;
+ }
+ theme = item;
+ }
+ }
+ if (theme) {
+ chrome.management.uninstall(theme.id, function() {
+ chrome.test.sendMessage("ready");
+ });
+ }
+});
+
Property changes on: chrome/test/data/extensions/management/themes/uninstall.js
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698