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

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

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 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 | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/extension_unpacker.cc » ('j') | 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) 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/common/extensions/extension_file_util.h" 5 #include "chrome/common/extensions/extension_file_util.h"
6 6
7 #include <map> 7 #include <map>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // error->empty(). For now, be consistent. 108 // error->empty(). For now, be consistent.
109 *error = l10n_util::GetStringUTF8(IDS_EXTENSION_MANIFEST_UNREADABLE); 109 *error = l10n_util::GetStringUTF8(IDS_EXTENSION_MANIFEST_UNREADABLE);
110 } else { 110 } else {
111 *error = base::StringPrintf("%s %s", 111 *error = base::StringPrintf("%s %s",
112 errors::kManifestParseError, 112 errors::kManifestParseError,
113 error->c_str()); 113 error->c_str());
114 } 114 }
115 return NULL; 115 return NULL;
116 } 116 }
117 117
118 if (!root->IsType(Value::TYPE_DICTIONARY)) { 118 if (!root->IsDictionary()) {
119 *error = l10n_util::GetStringUTF8(IDS_EXTENSION_MANIFEST_INVALID); 119 *error = l10n_util::GetStringUTF8(IDS_EXTENSION_MANIFEST_INVALID);
120 return NULL; 120 return NULL;
121 } 121 }
122 122
123 DictionaryValue* manifest = static_cast<DictionaryValue*>(root.get()); 123 DictionaryValue* manifest = static_cast<DictionaryValue*>(root.get());
124 if (!extension_l10n_util::LocalizeExtension(extension_path, manifest, error)) 124 if (!extension_l10n_util::LocalizeExtension(extension_path, manifest, error))
125 return NULL; 125 return NULL;
126 126
127 scoped_refptr<Extension> extension(Extension::Create( 127 scoped_refptr<Extension> extension(Extension::Create(
128 extension_path, 128 extension_path,
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 return temp_path; 614 return temp_path;
615 615
616 return FilePath(); 616 return FilePath();
617 } 617 }
618 618
619 void DeleteFile(const FilePath& path, bool recursive) { 619 void DeleteFile(const FilePath& path, bool recursive) {
620 file_util::Delete(path, recursive); 620 file_util::Delete(path, recursive);
621 } 621 }
622 622
623 } // namespace extension_file_util 623 } // namespace extension_file_util
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/extension_unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698