Make ungranted extension permissions not be an error, but show a warning
in the extension developer mode.

For example, the following permissions wouldn't be granted:
 - foobar
   It's not a real permission.
 - http://google.com:80
   It's a malformed URL pattern.
 - storage
   (If manifest_version == 1) because manifest_version must be >= 2.
 - storage
   (If on stable/beta channel) because it's only supported on dev channel.


BUG=121826
TEST=unit_tests --gtest_fitler='*ExtensionManifestTest*'
     Fake beta channel and try installing stylizr


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133144 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 23c02931..29ddca6d 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -6,12 +6,12 @@
 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_
 #pragma once
 
+#include <algorithm>
 #include <map>
 #include <set>
 #include <string>
 #include <utility>
 #include <vector>
-#include <algorithm>
 
 #include "base/file_path.h"
 #include "base/gtest_prod_util.h"
@@ -615,6 +615,9 @@
   const ExtensionPermissionSet* required_permission_set() const {
     return required_permission_set_.get();
   }
+  const std::vector<std::string>& install_warnings() const {
+    return install_warnings_;
+  }
   const GURL& update_url() const { return update_url_; }
   const ExtensionIconSet& icons() const { return icons_; }
   const extensions::Manifest* manifest() const {
@@ -908,6 +911,9 @@
   // The extension's required / default set of permissions.
   scoped_refptr<const ExtensionPermissionSet> required_permission_set_;
 
+  // Any warnings that occurred when trying to create/parse the extension.
+  std::vector<std::string> install_warnings_;
+
   // The icons for the extension.
   ExtensionIconSet icons_;