OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/extension_util.h" | 5 #include "chrome/browser/extensions/extension_util.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 namespace { | 37 namespace { |
38 | 38 |
39 // The entry into the ExtensionPrefs for allowing an extension to script on | 39 // The entry into the ExtensionPrefs for allowing an extension to script on |
40 // all urls without explicit permission. | 40 // all urls without explicit permission. |
41 const char kExtensionAllowedOnAllUrlsPrefName[] = | 41 const char kExtensionAllowedOnAllUrlsPrefName[] = |
42 "extension_can_script_all_urls"; | 42 "extension_can_script_all_urls"; |
43 | 43 |
44 // Returns true if |extension_id| for an external component extension should | 44 // Returns true if |extension_id| for an external component extension should |
45 // always be enabled in incognito windows. | 45 // always be enabled in incognito windows. |
46 bool IsWhitelistedForIncognito(const std::string& extension_id) { | 46 bool IsWhitelistedForIncognito(const std::string& extension_id) { |
47 static const char* kExtensionWhitelist[] = { | 47 static const char* const kExtensionWhitelist[] = { |
48 "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900 | 48 "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900 |
49 "D57DE394F36DC1C3220E7604C575D29C51A6C495", // http://crbug.com/319444 | 49 "D57DE394F36DC1C3220E7604C575D29C51A6C495", // http://crbug.com/319444 |
50 "3F65507A3B39259B38C8173C6FFA3D12DF64CCE9" // http://crbug.com/371562 | 50 "3F65507A3B39259B38C8173C6FFA3D12DF64CCE9" // http://crbug.com/371562 |
51 }; | 51 }; |
52 | 52 |
53 return extensions::SimpleFeature::IsIdInList( | 53 return extensions::SimpleFeature::IsIdInList( |
54 extension_id, | 54 extension_id, |
55 std::set<std::string>( | 55 std::set<std::string>( |
56 kExtensionWhitelist, | 56 kExtensionWhitelist, |
57 kExtensionWhitelist + arraysize(kExtensionWhitelist))); | 57 kExtensionWhitelist + arraysize(kExtensionWhitelist))); |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 IDR_EXTENSION_DEFAULT_ICON); | 359 IDR_EXTENSION_DEFAULT_ICON); |
360 } | 360 } |
361 | 361 |
362 bool IsStreamlinedHostedAppsEnabled() { | 362 bool IsStreamlinedHostedAppsEnabled() { |
363 return CommandLine::ForCurrentProcess()->HasSwitch( | 363 return CommandLine::ForCurrentProcess()->HasSwitch( |
364 switches::kEnableStreamlinedHostedApps); | 364 switches::kEnableStreamlinedHostedApps); |
365 } | 365 } |
366 | 366 |
367 } // namespace util | 367 } // namespace util |
368 } // namespace extensions | 368 } // namespace extensions |
OLD | NEW |