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

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

Issue 6766002: Replace bools in extension creation with flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For landing Created 9 years, 9 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) 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/test_extension_prefs.h" 5 #include "chrome/browser/extensions/test_extension_prefs.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 return AddExtensionWithManifest(dictionary, Extension::INTERNAL); 101 return AddExtensionWithManifest(dictionary, Extension::INTERNAL);
102 } 102 }
103 103
104 scoped_refptr<Extension> TestExtensionPrefs::AddExtensionWithManifest( 104 scoped_refptr<Extension> TestExtensionPrefs::AddExtensionWithManifest(
105 const DictionaryValue& manifest, Extension::Location location) { 105 const DictionaryValue& manifest, Extension::Location location) {
106 std::string name; 106 std::string name;
107 EXPECT_TRUE(manifest.GetString(extension_manifest_keys::kName, &name)); 107 EXPECT_TRUE(manifest.GetString(extension_manifest_keys::kName, &name));
108 FilePath path = extensions_dir_.AppendASCII(name); 108 FilePath path = extensions_dir_.AppendASCII(name);
109 std::string errors; 109 std::string errors;
110 scoped_refptr<Extension> extension = Extension::Create( 110 scoped_refptr<Extension> extension = Extension::Create(
111 path, location, manifest, false, true, &errors); 111 path, location, manifest, Extension::STRICT_ERROR_CHECKS, &errors);
112 EXPECT_TRUE(extension); 112 EXPECT_TRUE(extension);
113 if (!extension) 113 if (!extension)
114 return NULL; 114 return NULL;
115 115
116 EXPECT_TRUE(Extension::IdIsValid(extension->id())); 116 EXPECT_TRUE(Extension::IdIsValid(extension->id()));
117 const bool kInitialIncognitoEnabled = false; 117 const bool kInitialIncognitoEnabled = false;
118 prefs_->OnExtensionInstalled(extension, Extension::ENABLED, 118 prefs_->OnExtensionInstalled(extension, Extension::ENABLED,
119 kInitialIncognitoEnabled); 119 kInitialIncognitoEnabled);
120 return extension; 120 return extension;
121 } 121 }
122 122
123 std::string TestExtensionPrefs::AddExtensionAndReturnId(std::string name) { 123 std::string TestExtensionPrefs::AddExtensionAndReturnId(std::string name) {
124 scoped_refptr<Extension> extension(AddExtension(name)); 124 scoped_refptr<Extension> extension(AddExtension(name));
125 return extension->id(); 125 return extension->id();
126 } 126 }
127 127
128 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const { 128 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const {
129 return pref_service_->CreateIncognitoPrefService( 129 return pref_service_->CreateIncognitoPrefService(
130 new ExtensionPrefStore(extension_pref_value_map_.get(), true)); 130 new ExtensionPrefStore(extension_pref_value_map_.get(), true));
131 } 131 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/sandboxed_extension_unpacker.cc ('k') | chrome/browser/sync/glue/extension_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698