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

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

Issue 126151: Fix a crash during extension installation (debug only).... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_pref_extension_provider.h" 5 #include "chrome/browser/extensions/external_pref_extension_provider.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/version.h" 9 #include "base/version.h"
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 scoped_ptr<Version> version; 59 scoped_ptr<Version> version;
60 version.reset(Version::GetVersionFromString(external_version)); 60 version.reset(Version::GetVersionFromString(external_version));
61 visitor->OnExternalExtensionFound( 61 visitor->OnExternalExtensionFound(
62 WideToASCII(extension_id), version.get(), FilePath(external_crx)); 62 WideToASCII(extension_id), version.get(), FilePath(external_crx));
63 } 63 }
64 } 64 }
65 65
66 Version* ExternalPrefExtensionProvider::RegisteredVersion( 66 Version* ExternalPrefExtensionProvider::RegisteredVersion(
67 std::string id, Extension::Location* location) const { 67 std::string id, Extension::Location* location) const {
68 DictionaryValue* extension = NULL; 68 DictionaryValue* extension = NULL;
69 if (!prefs_->GetDictionary(ASCIIToWide(id), &extension)) { 69 if (!prefs_->GetDictionary(ASCIIToWide(id), &extension))
70 NOTREACHED() << "Cannot read extension " << id.c_str()
71 << " from dictionary.";
72 return NULL; 70 return NULL;
73 }
74 71
75 std::string external_version; 72 std::string external_version;
76 if (!extension->GetString(kExternalVersion, &external_version)) 73 if (!extension->GetString(kExternalVersion, &external_version))
77 return NULL; 74 return NULL;
78 75
79 if (location) 76 if (location)
80 *location = Extension::EXTERNAL_PREF; 77 *location = Extension::EXTERNAL_PREF;
81 return Version::GetVersionFromString(external_version); 78 return Version::GetVersionFromString(external_version);
82 } 79 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698