Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: chrome/browser/extensions/external_component_loader.cc

Issue 635573005: Cleanup: Better constify some strings in chrome/browser/{chromeos,extensions}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix cros, really Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 21
22 ExternalComponentLoader::ExternalComponentLoader(Profile* profile) 22 ExternalComponentLoader::ExternalComponentLoader(Profile* profile)
23 : profile_(profile) { 23 : profile_(profile) {
24 } 24 }
25 25
26 ExternalComponentLoader::~ExternalComponentLoader() {} 26 ExternalComponentLoader::~ExternalComponentLoader() {}
27 27
28 // static 28 // static
29 bool ExternalComponentLoader::IsModifiable(const Extension* extension) { 29 bool ExternalComponentLoader::IsModifiable(const Extension* extension) {
30 if (extension->location() == Manifest::EXTERNAL_COMPONENT) { 30 if (extension->location() == Manifest::EXTERNAL_COMPONENT) {
31 static const char* enhanced_extension_hashes[] = { 31 static const char* const enhanced_extension_hashes[] = {
32 "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900 32 "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900
33 "D57DE394F36DC1C3220E7604C575D29C51A6C495", // http://crbug.com/319444 33 "D57DE394F36DC1C3220E7604C575D29C51A6C495", // http://crbug.com/319444
34 "3F65507A3B39259B38C8173C6FFA3D12DF64CCE9" // http://crbug.com/371562 34 "3F65507A3B39259B38C8173C6FFA3D12DF64CCE9" // http://crbug.com/371562
35 }; 35 };
36 std::string hash = base::SHA1HashString(extension->id()); 36 std::string hash = base::SHA1HashString(extension->id());
37 hash = base::HexEncode(hash.c_str(), hash.length()); 37 hash = base::HexEncode(hash.c_str(), hash.length());
38 for (size_t i = 0; i < arraysize(enhanced_extension_hashes); i++) 38 for (size_t i = 0; i < arraysize(enhanced_extension_hashes); i++)
39 if (hash == enhanced_extension_hashes[i]) 39 if (hash == enhanced_extension_hashes[i])
40 return true; 40 return true;
41 } 41 }
(...skipping 22 matching lines...) Expand all
64 if (GetBookmarksExperimentExtensionID(profile_->GetPrefs(), &ext_id) && 64 if (GetBookmarksExperimentExtensionID(profile_->GetPrefs(), &ext_id) &&
65 !ext_id.empty()) { 65 !ext_id.empty()) {
66 prefs_->SetString(ext_id + ".external_update_url", 66 prefs_->SetString(ext_id + ".external_update_url",
67 extension_urls::GetWebstoreUpdateUrl().spec()); 67 extension_urls::GetWebstoreUpdateUrl().spec());
68 } 68 }
69 69
70 LoadFinished(); 70 LoadFinished();
71 } 71 }
72 72
73 } // namespace extensions 73 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698