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

Side by Side Diff: chrome/test/testing_profile.cc

Issue 6852029: [Sync] Move some extension-sync-related logic to ExtensionService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address asargent's comments Created 9 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
« no previous file with comments | « chrome/test/testing_profile.h ('k') | 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) 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/test/testing_profile.h" 5 #include "chrome/test/testing_profile.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 void TestingProfile::CreateTemplateURLModel() { 338 void TestingProfile::CreateTemplateURLModel() {
339 SetTemplateURLModel(new TemplateURLModel(this)); 339 SetTemplateURLModel(new TemplateURLModel(this));
340 } 340 }
341 341
342 void TestingProfile::SetTemplateURLModel(TemplateURLModel* model) { 342 void TestingProfile::SetTemplateURLModel(TemplateURLModel* model) {
343 template_url_model_.reset(model); 343 template_url_model_.reset(model);
344 } 344 }
345 345
346 ExtensionService* TestingProfile::CreateExtensionService( 346 ExtensionService* TestingProfile::CreateExtensionService(
347 const CommandLine* command_line, 347 const CommandLine* command_line,
348 const FilePath& install_directory) { 348 const FilePath& install_directory,
349 bool autoupdate_enabled) {
349 // Extension pref store, created for use by |extension_prefs_|. 350 // Extension pref store, created for use by |extension_prefs_|.
350 351
351 extension_pref_value_map_.reset(new ExtensionPrefValueMap); 352 extension_pref_value_map_.reset(new ExtensionPrefValueMap);
352 // Note that the GetPrefs() creates a TestingPrefService, therefore 353 // Note that the GetPrefs() creates a TestingPrefService, therefore
353 // the extension controlled pref values set in extension_prefs_ 354 // the extension controlled pref values set in extension_prefs_
354 // are not reflected in the pref service. One would need to 355 // are not reflected in the pref service. One would need to
355 // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false). 356 // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false).
356 extension_prefs_.reset( 357 extension_prefs_.reset(
357 new ExtensionPrefs(GetPrefs(), 358 new ExtensionPrefs(GetPrefs(),
358 install_directory, 359 install_directory,
359 extension_pref_value_map_.get())); 360 extension_pref_value_map_.get()));
360 extensions_service_ = new ExtensionService(this, 361 extensions_service_ = new ExtensionService(this,
361 command_line, 362 command_line,
362 install_directory, 363 install_directory,
363 extension_prefs_.get(), 364 extension_prefs_.get(),
364 false, 365 autoupdate_enabled,
365 true); 366 true);
366 return extensions_service_; 367 return extensions_service_;
367 } 368 }
368 369
369 FilePath TestingProfile::GetPath() { 370 FilePath TestingProfile::GetPath() {
370 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better. 371 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better.
371 return temp_dir_.path(); 372 return temp_dir_.path();
372 } 373 }
373 374
374 TestingPrefService* TestingProfile::GetTestingPrefService() { 375 TestingPrefService* TestingProfile::GetTestingPrefService() {
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 } 810 }
810 811
811 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) 812 DerivedTestingProfile::DerivedTestingProfile(Profile* profile)
812 : original_profile_(profile) {} 813 : original_profile_(profile) {}
813 814
814 DerivedTestingProfile::~DerivedTestingProfile() {} 815 DerivedTestingProfile::~DerivedTestingProfile() {}
815 816
816 ProfileId DerivedTestingProfile::GetRuntimeId() { 817 ProfileId DerivedTestingProfile::GetRuntimeId() {
817 return original_profile_->GetRuntimeId(); 818 return original_profile_->GetRuntimeId();
818 } 819 }
OLDNEW
« no previous file with comments | « chrome/test/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698