OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/shell/common/shell_extensions_client.h" | 5 #include "extensions/shell/common/shell_extensions_client.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "extensions/common/api/generated_schemas.h" | 9 #include "extensions/common/api/generated_schemas.h" |
10 #include "extensions/common/common_manifest_handlers.h" | 10 #include "extensions/common/common_manifest_handlers.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 template <class FeatureClass> | 31 template <class FeatureClass> |
32 SimpleFeature* CreateFeature() { | 32 SimpleFeature* CreateFeature() { |
33 return new FeatureClass; | 33 return new FeatureClass; |
34 } | 34 } |
35 | 35 |
36 // TODO(jamescook): Refactor ChromePermissionsMessageProvider so we can share | 36 // TODO(jamescook): Refactor ChromePermissionsMessageProvider so we can share |
37 // code. For now, this implementation does nothing. | 37 // code. For now, this implementation does nothing. |
38 class ShellPermissionMessageProvider : public PermissionMessageProvider { | 38 class ShellPermissionMessageProvider : public PermissionMessageProvider { |
39 public: | 39 public: |
40 ShellPermissionMessageProvider() {} | 40 ShellPermissionMessageProvider() {} |
41 virtual ~ShellPermissionMessageProvider() {} | 41 ~ShellPermissionMessageProvider() override {} |
42 | 42 |
43 // PermissionMessageProvider implementation. | 43 // PermissionMessageProvider implementation. |
44 virtual PermissionMessages GetPermissionMessages( | 44 PermissionMessages GetPermissionMessages( |
45 const PermissionSet* permissions, | 45 const PermissionSet* permissions, |
46 Manifest::Type extension_type) const override { | 46 Manifest::Type extension_type) const override { |
47 return PermissionMessages(); | 47 return PermissionMessages(); |
48 } | 48 } |
49 | 49 |
50 virtual std::vector<base::string16> GetWarningMessages( | 50 std::vector<base::string16> GetWarningMessages( |
51 const PermissionSet* permissions, | 51 const PermissionSet* permissions, |
52 Manifest::Type extension_type) const override { | 52 Manifest::Type extension_type) const override { |
53 return std::vector<base::string16>(); | 53 return std::vector<base::string16>(); |
54 } | 54 } |
55 | 55 |
56 virtual std::vector<base::string16> GetWarningMessagesDetails( | 56 std::vector<base::string16> GetWarningMessagesDetails( |
57 const PermissionSet* permissions, | 57 const PermissionSet* permissions, |
58 Manifest::Type extension_type) const override { | 58 Manifest::Type extension_type) const override { |
59 return std::vector<base::string16>(); | 59 return std::vector<base::string16>(); |
60 } | 60 } |
61 | 61 |
62 virtual bool IsPrivilegeIncrease( | 62 bool IsPrivilegeIncrease(const PermissionSet* old_permissions, |
63 const PermissionSet* old_permissions, | 63 const PermissionSet* new_permissions, |
64 const PermissionSet* new_permissions, | 64 Manifest::Type extension_type) const override { |
65 Manifest::Type extension_type) const override { | |
66 // Ensure we implement this before shipping. | 65 // Ensure we implement this before shipping. |
67 CHECK(false); | 66 CHECK(false); |
68 return false; | 67 return false; |
69 } | 68 } |
70 | 69 |
71 private: | 70 private: |
72 DISALLOW_COPY_AND_ASSIGN(ShellPermissionMessageProvider); | 71 DISALLOW_COPY_AND_ASSIGN(ShellPermissionMessageProvider); |
73 }; | 72 }; |
74 | 73 |
75 base::LazyInstance<ShellPermissionMessageProvider> | 74 base::LazyInstance<ShellPermissionMessageProvider> |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 return extension_urls::kChromeWebstoreUpdateURL; | 203 return extension_urls::kChromeWebstoreUpdateURL; |
205 } | 204 } |
206 | 205 |
207 bool ShellExtensionsClient::IsBlacklistUpdateURL(const GURL& url) const { | 206 bool ShellExtensionsClient::IsBlacklistUpdateURL(const GURL& url) const { |
208 // TODO(rockot): Maybe we want to do something else here. For now we accept | 207 // TODO(rockot): Maybe we want to do something else here. For now we accept |
209 // any URL as a blacklist URL because we don't really care. | 208 // any URL as a blacklist URL because we don't really care. |
210 return true; | 209 return true; |
211 } | 210 } |
212 | 211 |
213 } // namespace extensions | 212 } // namespace extensions |
OLD | NEW |