PageActions can now specify multiple icons and switch between them
using optional parameters to enableForTab.

BUG=http://crbug.com/11906
TEST=None

Review URL: http://codereview.chromium.org/149046

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19772 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index df59e04..b44c630 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -753,12 +753,16 @@
   for (PageActionMap::const_iterator i(page_actions.begin());
        i != page_actions.end(); ++i) {
     PageAction* page_action = i->second;
-    FilePath path = page_action->icon_path();
-    if (!file_util::PathExists(path)) {
-      ReportExtensionLoadError(extension_path,
-          StringPrintf("Could not load icon '%s' for page action.",
-          WideToUTF8(path.ToWStringHack()).c_str()));
-      return NULL;
+    const std::vector<FilePath>& icon_paths = page_action->icon_paths();
+    for (std::vector<FilePath>::const_iterator iter = icon_paths.begin();
+         iter != icon_paths.end(); ++iter) {
+      FilePath path = *iter;
+      if (!file_util::PathExists(path)) {
+        ReportExtensionLoadError(extension_path,
+            StringPrintf("Could not load icon '%s' for page action.",
+            WideToUTF8(path.ToWStringHack()).c_str()));
+        return NULL;
+      }
     }
   }