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

Side by Side Diff: chrome/common/extensions/extension.cc

Issue 3968001: Update code that previously constructed strings from string iterators only to... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 const int kRSAKeySize = 1024; 58 const int kRSAKeySize = 1024;
59 59
60 // Converts a normal hexadecimal string into the alphabet used by extensions. 60 // Converts a normal hexadecimal string into the alphabet used by extensions.
61 // We use the characters 'a'-'p' instead of '0'-'f' to avoid ever having a 61 // We use the characters 'a'-'p' instead of '0'-'f' to avoid ever having a
62 // completely numeric host, since some software interprets that as an IP 62 // completely numeric host, since some software interprets that as an IP
63 // address. 63 // address.
64 static void ConvertHexadecimalToIDAlphabet(std::string* id) { 64 static void ConvertHexadecimalToIDAlphabet(std::string* id) {
65 for (size_t i = 0; i < id->size(); ++i) { 65 for (size_t i = 0; i < id->size(); ++i) {
66 int val; 66 int val;
67 if (base::HexStringToInt(id->substr(i, 1), &val)) 67 if (base::HexStringToInt(id->begin() + i, id->begin() + i + 1, &val))
68 (*id)[i] = val + 'a'; 68 (*id)[i] = val + 'a';
69 else 69 else
70 (*id)[i] = 'a'; 70 (*id)[i] = 'a';
71 } 71 }
72 } 72 }
73 73
74 const int kValidWebExtentSchemes = 74 const int kValidWebExtentSchemes =
75 URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS; 75 URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS;
76 76
77 // These keys are allowed by all crx files (apps, extensions, themes, etc). 77 // These keys are allowed by all crx files (apps, extensions, themes, etc).
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 // We purposefully don't put this into kPermissionNames. 248 // We purposefully don't put this into kPermissionNames.
249 const char Extension::kOldUnlimitedStoragePermission[] = "unlimited_storage"; 249 const char Extension::kOldUnlimitedStoragePermission[] = "unlimited_storage";
250 250
251 // 251 //
252 // Extension::StaticData 252 // Extension::StaticData
253 // 253 //
254 254
255 Extension::StaticData::StaticData() 255 Extension::StaticData::StaticData()
256 : incognito_split_mode(false), 256 : incognito_split_mode(false),
257 location(INVALID), 257 location(INVALID),
erikwright (departed) 2010/10/22 13:50:23 Unrelated change in Trunk.
258 converted_from_user_script(false), 258 converted_from_user_script(false),
259 is_theme(false), 259 is_theme(false),
260 is_app(false), 260 is_app(false),
261 launch_container(extension_misc::LAUNCH_TAB), 261 launch_container(extension_misc::LAUNCH_TAB),
262 launch_width(0), 262 launch_width(0),
263 launch_height(0) { 263 launch_height(0) {
264 } 264 }
265 265
266 Extension::StaticData::~StaticData() { 266 Extension::StaticData::~StaticData() {
267 } 267 }
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after
2233 UninstalledExtensionInfo::UninstalledExtensionInfo( 2233 UninstalledExtensionInfo::UninstalledExtensionInfo(
2234 const Extension& extension) 2234 const Extension& extension)
2235 : extension_id(extension.id()), 2235 : extension_id(extension.id()),
2236 extension_api_permissions(extension.api_permissions()), 2236 extension_api_permissions(extension.api_permissions()),
2237 is_theme(extension.is_theme()), 2237 is_theme(extension.is_theme()),
2238 is_app(extension.is_app()), 2238 is_app(extension.is_app()),
2239 converted_from_user_script(extension.converted_from_user_script()), 2239 converted_from_user_script(extension.converted_from_user_script()),
2240 update_url(extension.update_url()) {} 2240 update_url(extension.update_url()) {}
2241 2241
2242 UninstalledExtensionInfo::~UninstalledExtensionInfo() {} 2242 UninstalledExtensionInfo::~UninstalledExtensionInfo() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698