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

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

Issue 9320021: Fix crash in ExtensionService::InitializePermissions(). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add the test data Created 8 years, 10 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/installed_loader.h" 5 #include "chrome/browser/extensions/installed_loader.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 info.extension_location, 77 info.extension_location,
78 *info.extension_manifest, 78 *info.extension_manifest,
79 GetCreationFlags(&info), 79 GetCreationFlags(&info),
80 &error); 80 &error);
81 } else { 81 } else {
82 error = errors::kManifestUnreadable; 82 error = errors::kManifestUnreadable;
83 } 83 }
84 84
85 // Once installed, non-unpacked extensions cannot change their IDs (e.g., by 85 // Once installed, non-unpacked extensions cannot change their IDs (e.g., by
86 // updating the 'key' field in their manifest). 86 // updating the 'key' field in their manifest).
87 // TODO(jstritar): migrate preferences when unpacked extensions change IDs.
87 if (extension && 88 if (extension &&
88 extension->location() != Extension::LOAD && 89 extension->location() != Extension::LOAD &&
89 info.extension_id != extension->id()) { 90 info.extension_id != extension->id()) {
90 error = errors::kCannotChangeExtensionID; 91 error = errors::kCannotChangeExtensionID;
91 extension = NULL; 92 extension = NULL;
92 content::RecordAction(UserMetricsAction("Extensions.IDChangedError")); 93 content::RecordAction(UserMetricsAction("Extensions.IDChangedError"));
93 } 94 }
94 95
95 if (!extension) { 96 if (!extension) {
96 extension_service_-> 97 extension_service_->
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 if (extension_prefs_->AllowFileAccess(info->extension_id)) 278 if (extension_prefs_->AllowFileAccess(info->extension_id))
278 flags |= Extension::ALLOW_FILE_ACCESS; 279 flags |= Extension::ALLOW_FILE_ACCESS;
279 if (extension_prefs_->IsFromWebStore(info->extension_id)) 280 if (extension_prefs_->IsFromWebStore(info->extension_id))
280 flags |= Extension::FROM_WEBSTORE; 281 flags |= Extension::FROM_WEBSTORE;
281 if (extension_prefs_->IsFromBookmark(info->extension_id)) 282 if (extension_prefs_->IsFromBookmark(info->extension_id))
282 flags |= Extension::FROM_BOOKMARK; 283 flags |= Extension::FROM_BOOKMARK;
283 return flags; 284 return flags;
284 } 285 }
285 286
286 } // namespace extensions 287 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/extensions/permissions_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698