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

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

Issue 10086019: Use the non-localized "canonical name" of an extension to write to its sync (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rename, test Created 8 years, 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/base64.h" 9 #include "base/base64.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 return false; 1128 return false;
1129 return true; 1129 return true;
1130 } 1130 }
1131 1131
1132 bool Extension::LoadName(string16* error) { 1132 bool Extension::LoadName(string16* error) {
1133 string16 localized_name; 1133 string16 localized_name;
1134 if (!manifest_->GetString(keys::kName, &localized_name)) { 1134 if (!manifest_->GetString(keys::kName, &localized_name)) {
1135 *error = ASCIIToUTF16(errors::kInvalidName); 1135 *error = ASCIIToUTF16(errors::kInvalidName);
1136 return false; 1136 return false;
1137 } 1137 }
1138 non_localized_name_ = UTF16ToUTF8(localized_name);
1138 base::i18n::AdjustStringForLocaleDirection(&localized_name); 1139 base::i18n::AdjustStringForLocaleDirection(&localized_name);
1139 name_ = UTF16ToUTF8(localized_name); 1140 name_ = UTF16ToUTF8(localized_name);
1140 return true; 1141 return true;
1141 } 1142 }
1142 1143
1143 bool Extension::LoadDescription(string16* error) { 1144 bool Extension::LoadDescription(string16* error) {
1144 if (manifest_->HasKey(keys::kDescription) && 1145 if (manifest_->HasKey(keys::kDescription) &&
1145 !manifest_->GetString(keys::kDescription, &description_)) { 1146 !manifest_->GetString(keys::kDescription, &description_)) {
1146 *error = ASCIIToUTF16(errors::kInvalidDescription); 1147 *error = ASCIIToUTF16(errors::kInvalidDescription);
1147 return false; 1148 return false;
(...skipping 2556 matching lines...) Expand 10 before | Expand all | Expand 10 after
3704 already_disabled(false), 3705 already_disabled(false),
3705 extension(extension) {} 3706 extension(extension) {}
3706 3707
3707 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 3708 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
3708 const Extension* extension, 3709 const Extension* extension,
3709 const ExtensionPermissionSet* permissions, 3710 const ExtensionPermissionSet* permissions,
3710 Reason reason) 3711 Reason reason)
3711 : reason(reason), 3712 : reason(reason),
3712 extension(extension), 3713 extension(extension),
3713 permissions(permissions) {} 3714 permissions(permissions) {}
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_manifests_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698