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

Side by Side Diff: chrome/browser/themes/theme_syncable_service_unittest.cc

Issue 156843004: Remove ExtensionService::extension_prefs() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix UserScriptListenerTests.MultiProfile Created 6 years, 10 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) 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/browser/themes/theme_syncable_service.h" 5 #include "chrome/browser/themes/theme_syncable_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 theme_extension_ = MakeThemeExtension(base::FilePath(kExtensionFilePath), 204 theme_extension_ = MakeThemeExtension(base::FilePath(kExtensionFilePath),
205 kCustomThemeName, 205 kCustomThemeName,
206 GetThemeLocation(), 206 GetThemeLocation(),
207 kCustomThemeUrl); 207 kCustomThemeUrl);
208 extensions::APIPermissionSet empty_set; 208 extensions::APIPermissionSet empty_set;
209 extensions::ManifestPermissionSet empty_manifest_permissions; 209 extensions::ManifestPermissionSet empty_manifest_permissions;
210 extensions::URLPatternSet empty_extent; 210 extensions::URLPatternSet empty_extent;
211 scoped_refptr<extensions::PermissionSet> permissions = 211 scoped_refptr<extensions::PermissionSet> permissions =
212 new extensions::PermissionSet(empty_set, empty_manifest_permissions, 212 new extensions::PermissionSet(empty_set, empty_manifest_permissions,
213 empty_extent, empty_extent); 213 empty_extent, empty_extent);
214 service->extension_prefs()->AddGrantedPermissions( 214 extensions::ExtensionPrefs::Get(profile_.get())
215 theme_extension_->id(), permissions.get()); 215 ->AddGrantedPermissions(theme_extension_->id(), permissions.get());
216 service->AddExtension(theme_extension_.get()); 216 service->AddExtension(theme_extension_.get());
217 ASSERT_EQ(1u, service->extensions()->size()); 217 ASSERT_EQ(1u, service->extensions()->size());
218 } 218 }
219 219
220 // Overridden in PolicyInstalledThemeTest below. 220 // Overridden in PolicyInstalledThemeTest below.
221 virtual extensions::Manifest::Location GetThemeLocation() { 221 virtual extensions::Manifest::Location GetThemeLocation() {
222 return extensions::Manifest::INTERNAL; 222 return extensions::Manifest::INTERNAL;
223 } 223 }
224 224
225 FakeThemeService* BuildForProfile(Profile* profile) { 225 FakeThemeService* BuildForProfile(Profile* profile) {
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 620
621 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) { 621 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) {
622 // Set up theme service to use custom theme that was installed by policy. 622 // Set up theme service to use custom theme that was installed by policy.
623 fake_theme_service_->SetTheme(theme_extension_.get()); 623 fake_theme_service_->SetTheme(theme_extension_.get());
624 624
625 syncer::SyncDataList data_list = 625 syncer::SyncDataList data_list =
626 theme_sync_service_->GetAllSyncData(syncer::THEMES); 626 theme_sync_service_->GetAllSyncData(syncer::THEMES);
627 627
628 ASSERT_EQ(0u, data_list.size()); 628 ASSERT_EQ(0u, data_list.size());
629 } 629 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_syncable_service.cc ('k') | chrome/browser/ui/app_list/app_list_controller_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698