OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/external_component_loader.h" | 5 #include "chrome/browser/extensions/external_component_loader.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/sha1.h" | 8 #include "base/sha1.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" | 10 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 ExternalComponentLoader::ExternalComponentLoader(Profile* profile) | 26 ExternalComponentLoader::ExternalComponentLoader(Profile* profile) |
27 : profile_(profile) { | 27 : profile_(profile) { |
28 } | 28 } |
29 | 29 |
30 ExternalComponentLoader::~ExternalComponentLoader() {} | 30 ExternalComponentLoader::~ExternalComponentLoader() {} |
31 | 31 |
32 // static | 32 // static |
33 bool ExternalComponentLoader::IsModifiable(const Extension* extension) { | 33 bool ExternalComponentLoader::IsModifiable(const Extension* extension) { |
34 if (extension->location() == Manifest::EXTERNAL_COMPONENT) { | 34 if (extension->location() == Manifest::EXTERNAL_COMPONENT) { |
35 static const char* enhanced_extension_hashes[] = { | 35 static const char* const enhanced_extension_hashes[] = { |
36 "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900 | 36 "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900 |
37 "D57DE394F36DC1C3220E7604C575D29C51A6C495", // http://crbug.com/319444 | 37 "D57DE394F36DC1C3220E7604C575D29C51A6C495", // http://crbug.com/319444 |
38 "3F65507A3B39259B38C8173C6FFA3D12DF64CCE9" // http://crbug.com/371562 | 38 "3F65507A3B39259B38C8173C6FFA3D12DF64CCE9" // http://crbug.com/371562 |
39 }; | 39 }; |
40 std::string hash = base::SHA1HashString(extension->id()); | 40 std::string hash = base::SHA1HashString(extension->id()); |
41 hash = base::HexEncode(hash.c_str(), hash.length()); | 41 hash = base::HexEncode(hash.c_str(), hash.length()); |
42 for (size_t i = 0; i < arraysize(enhanced_extension_hashes); i++) | 42 for (size_t i = 0; i < arraysize(enhanced_extension_hashes); i++) |
43 if (hash == enhanced_extension_hashes[i]) | 43 if (hash == enhanced_extension_hashes[i]) |
44 return true; | 44 return true; |
45 } | 45 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 prefs_->SetString(extension_id + ".external_update_url", | 82 prefs_->SetString(extension_id + ".external_update_url", |
83 extension_urls::GetWebstoreUpdateUrl().spec()); | 83 extension_urls::GetWebstoreUpdateUrl().spec()); |
84 } | 84 } |
85 } | 85 } |
86 #endif | 86 #endif |
87 | 87 |
88 LoadFinished(); | 88 LoadFinished(); |
89 } | 89 } |
90 | 90 |
91 } // namespace extensions | 91 } // namespace extensions |
OLD | NEW |