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

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

Issue 7189029: Implement an initial extension settings API. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: dgrogan comments #2, mihai comments #1 Created 9 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
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"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/message_loop_proxy.h" 12 #include "base/message_loop_proxy.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/string_number_conversions.h" 14 #include "base/string_number_conversions.h"
15 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 15 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
16 #include "chrome/browser/background/background_contents_service_factory.h" 16 #include "chrome/browser/background/background_contents_service_factory.h"
17 #include "chrome/browser/bookmarks/bookmark_model.h" 17 #include "chrome/browser/bookmarks/bookmark_model.h"
18 #include "chrome/browser/browser_process.h" 18 #include "chrome/browser/browser_process.h"
19 #include "chrome/browser/content_settings/host_content_settings_map.h" 19 #include "chrome/browser/content_settings/host_content_settings_map.h"
20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
21 #include "chrome/browser/extensions/extension_pref_value_map.h" 21 #include "chrome/browser/extensions/extension_pref_value_map.h"
22 #include "chrome/browser/extensions/extension_service.h" 22 #include "chrome/browser/extensions/extension_service.h"
23 #include "chrome/browser/extensions/extension_settings.h"
23 #include "chrome/browser/extensions/extension_special_storage_policy.h" 24 #include "chrome/browser/extensions/extension_special_storage_policy.h"
24 #include "chrome/browser/favicon/favicon_service.h" 25 #include "chrome/browser/favicon/favicon_service.h"
25 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" 26 #include "chrome/browser/geolocation/geolocation_content_settings_map.h"
26 #include "chrome/browser/history/history.h" 27 #include "chrome/browser/history/history.h"
27 #include "chrome/browser/history/history_backend.h" 28 #include "chrome/browser/history/history_backend.h"
28 #include "chrome/browser/history/top_sites.h" 29 #include "chrome/browser/history/top_sites.h"
29 #include "chrome/browser/net/gaia/token_service.h" 30 #include "chrome/browser/net/gaia/token_service.h"
30 #include "chrome/browser/net/pref_proxy_config_service.h" 31 #include "chrome/browser/net/pref_proxy_config_service.h"
31 #include "chrome/browser/notifications/desktop_notification_service.h" 32 #include "chrome/browser/notifications/desktop_notification_service.h"
32 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 33 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 332
332 extension_pref_value_map_.reset(new ExtensionPrefValueMap); 333 extension_pref_value_map_.reset(new ExtensionPrefValueMap);
333 // Note that the GetPrefs() creates a TestingPrefService, therefore 334 // Note that the GetPrefs() creates a TestingPrefService, therefore
334 // the extension controlled pref values set in extension_prefs_ 335 // the extension controlled pref values set in extension_prefs_
335 // are not reflected in the pref service. One would need to 336 // are not reflected in the pref service. One would need to
336 // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false). 337 // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false).
337 extension_prefs_.reset( 338 extension_prefs_.reset(
338 new ExtensionPrefs(GetPrefs(), 339 new ExtensionPrefs(GetPrefs(),
339 install_directory, 340 install_directory,
340 extension_pref_value_map_.get())); 341 extension_pref_value_map_.get()));
342 extension_settings_.reset(
343 new ExtensionSettings(GetPath().Append("Extension Settings")));
341 extension_service_.reset(new ExtensionService(this, 344 extension_service_.reset(new ExtensionService(this,
342 command_line, 345 command_line,
343 install_directory, 346 install_directory,
344 extension_prefs_.get(), 347 extension_prefs_.get(),
348 extension_settings_.get(),
345 autoupdate_enabled, 349 autoupdate_enabled,
346 true)); 350 true));
347 return extension_service_.get(); 351 return extension_service_.get();
348 } 352 }
349 353
350 FilePath TestingProfile::GetPath() { 354 FilePath TestingProfile::GetPath() {
351 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better. 355 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better.
352 return temp_dir_.path(); 356 return temp_dir_.path();
353 } 357 }
354 358
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 } 796 }
793 797
794 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) 798 DerivedTestingProfile::DerivedTestingProfile(Profile* profile)
795 : original_profile_(profile) {} 799 : original_profile_(profile) {}
796 800
797 DerivedTestingProfile::~DerivedTestingProfile() {} 801 DerivedTestingProfile::~DerivedTestingProfile() {}
798 802
799 ProfileId DerivedTestingProfile::GetRuntimeId() { 803 ProfileId DerivedTestingProfile::GetRuntimeId() {
800 return original_profile_->GetRuntimeId(); 804 return original_profile_->GetRuntimeId();
801 } 805 }
OLDNEW
« chrome/test/data/extensions/api_test/settings/test.html ('K') | « chrome/test/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698