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

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

Issue 902833003: Add a HostContentSettingsMap layer for Supervised Users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Comments Created 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/testing_profile.h" 5 #include "chrome/test/base/testing_profile.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 #include "chrome/browser/extensions/test_extension_system.h" 100 #include "chrome/browser/extensions/test_extension_system.h"
101 #include "extensions/browser/extension_system.h" 101 #include "extensions/browser/extension_system.h"
102 #include "extensions/browser/guest_view/guest_view_manager.h" 102 #include "extensions/browser/guest_view/guest_view_manager.h"
103 #endif 103 #endif
104 104
105 #if defined(OS_ANDROID) 105 #if defined(OS_ANDROID)
106 #include "chrome/browser/signin/android_profile_oauth2_token_service.h" 106 #include "chrome/browser/signin/android_profile_oauth2_token_service.h"
107 #endif 107 #endif
108 108
109 #if defined(ENABLE_SUPERVISED_USERS) 109 #if defined(ENABLE_SUPERVISED_USERS)
110 #include "chrome/browser/content_settings/content_settings_supervised_provider.h "
110 #include "chrome/browser/supervised_user/supervised_user_constants.h" 111 #include "chrome/browser/supervised_user/supervised_user_constants.h"
111 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" 112 #include "chrome/browser/supervised_user/supervised_user_settings_service.h"
112 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor y.h" 113 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor y.h"
113 #endif 114 #endif
114 115
115 using base::Time; 116 using base::Time;
116 using bookmarks::BookmarkModel; 117 using bookmarks::BookmarkModel;
117 using content::BrowserThread; 118 using content::BrowserThread;
118 using content::DownloadManagerDelegate; 119 using content::DownloadManagerDelegate;
119 using testing::NiceMock; 120 using testing::NiceMock;
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 if (!host_content_settings_map_.get()) { 913 if (!host_content_settings_map_.get()) {
913 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), false); 914 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), false);
914 #if defined(ENABLE_EXTENSIONS) 915 #if defined(ENABLE_EXTENSIONS)
915 ExtensionService* extension_service = 916 ExtensionService* extension_service =
916 extensions::ExtensionSystem::Get(this)->extension_service(); 917 extensions::ExtensionSystem::Get(this)->extension_service();
917 if (extension_service) { 918 if (extension_service) {
918 extension_service->RegisterContentSettings( 919 extension_service->RegisterContentSettings(
919 host_content_settings_map_.get()); 920 host_content_settings_map_.get());
920 } 921 }
921 #endif 922 #endif
923 #if defined(ENABLE_SUPERVISED_USERS)
924 SupervisedUserSettingsService* supervised_service =
Bernhard Bauer 2015/02/26 18:03:54 Hm... I'm not sure if a testing profile actually n
knn 2015/02/27 10:43:53 Removed as there are no tests testing supervised u
925 SupervisedUserSettingsServiceFactory::GetForProfile(this);
926 scoped_ptr<content_settings::SupervisedProvider> supervised_provider(
927 new content_settings::SupervisedProvider());
928 supervised_service->Subscribe(base::Bind(
929 &content_settings::SupervisedProvider::OnSupervisedSettingsAvailable,
930 base::Unretained(supervised_provider.get())));
931 host_content_settings_map_->RegisterProvider(
932 HostContentSettingsMap::SUPERVISED_PROVIDER,
933 supervised_provider.Pass());
934 #endif
922 } 935 }
923 return host_content_settings_map_.get(); 936 return host_content_settings_map_.get();
924 } 937 }
925 938
926 content::BrowserPluginGuestManager* TestingProfile::GetGuestManager() { 939 content::BrowserPluginGuestManager* TestingProfile::GetGuestManager() {
927 #if defined(ENABLE_EXTENSIONS) 940 #if defined(ENABLE_EXTENSIONS)
928 return extensions::GuestViewManager::FromBrowserContext(this); 941 return extensions::GuestViewManager::FromBrowserContext(this);
929 #else 942 #else
930 return NULL; 943 return NULL;
931 #endif 944 #endif
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 #if defined(ENABLE_EXTENSIONS) 1114 #if defined(ENABLE_EXTENSIONS)
1102 extension_policy_, 1115 extension_policy_,
1103 #endif 1116 #endif
1104 pref_service_.Pass(), 1117 pref_service_.Pass(),
1105 original_profile, 1118 original_profile,
1106 guest_session_, 1119 guest_session_,
1107 supervised_user_id_, 1120 supervised_user_id_,
1108 policy_service_.Pass(), 1121 policy_service_.Pass(),
1109 testing_factories_); 1122 testing_factories_);
1110 } 1123 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698