| OLD | NEW |
| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 is_dirty_ = false; | 106 is_dirty_ = false; |
| 107 } | 107 } |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 bool using_system_theme_; | 110 bool using_system_theme_; |
| 111 bool using_default_theme_; | 111 bool using_default_theme_; |
| 112 scoped_refptr<const extensions::Extension> theme_extension_; | 112 scoped_refptr<const extensions::Extension> theme_extension_; |
| 113 bool is_dirty_; | 113 bool is_dirty_; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 KeyedService* BuildMockThemeService(content::BrowserContext* profile) { | 116 scoped_ptr<KeyedService> BuildMockThemeService( |
| 117 return new FakeThemeService; | 117 content::BrowserContext* profile) { |
| 118 return make_scoped_ptr(new FakeThemeService); |
| 118 } | 119 } |
| 119 | 120 |
| 120 scoped_refptr<extensions::Extension> MakeThemeExtension( | 121 scoped_refptr<extensions::Extension> MakeThemeExtension( |
| 121 const base::FilePath& extension_path, | 122 const base::FilePath& extension_path, |
| 122 const string& name, | 123 const string& name, |
| 123 extensions::Manifest::Location location, | 124 extensions::Manifest::Location location, |
| 124 const string& update_url) { | 125 const string& update_url) { |
| 125 base::DictionaryValue source; | 126 base::DictionaryValue source; |
| 126 source.SetString(extensions::manifest_keys::kName, name); | 127 source.SetString(extensions::manifest_keys::kName, name); |
| 127 source.Set(extensions::manifest_keys::kTheme, new base::DictionaryValue()); | 128 source.Set(extensions::manifest_keys::kTheme, new base::DictionaryValue()); |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 | 653 |
| 653 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) { | 654 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) { |
| 654 // Set up theme service to use custom theme that was installed by policy. | 655 // Set up theme service to use custom theme that was installed by policy. |
| 655 fake_theme_service_->SetTheme(theme_extension_.get()); | 656 fake_theme_service_->SetTheme(theme_extension_.get()); |
| 656 | 657 |
| 657 syncer::SyncDataList data_list = | 658 syncer::SyncDataList data_list = |
| 658 theme_sync_service_->GetAllSyncData(syncer::THEMES); | 659 theme_sync_service_->GetAllSyncData(syncer::THEMES); |
| 659 | 660 |
| 660 ASSERT_EQ(0u, data_list.size()); | 661 ASSERT_EQ(0u, data_list.size()); |
| 661 } | 662 } |
| OLD | NEW |