| 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_service.h" | 5 #include "chrome/browser/themes/theme_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 if (!service) | 834 if (!service) |
| 835 return; | 835 return; |
| 836 | 836 |
| 837 // Write the packed file to disk. | 837 // Write the packed file to disk. |
| 838 base::FilePath pack_path = | 838 base::FilePath pack_path = |
| 839 extension->path().Append(ui::MaterialDesignController::IsModeMaterial() | 839 extension->path().Append(ui::MaterialDesignController::IsModeMaterial() |
| 840 ? chrome::kThemePackMaterialDesignFilename | 840 ? chrome::kThemePackMaterialDesignFilename |
| 841 : chrome::kThemePackFilename); | 841 : chrome::kThemePackFilename); |
| 842 service->GetFileTaskRunner()->PostTask( | 842 service->GetFileTaskRunner()->PostTask( |
| 843 FROM_HERE, | 843 FROM_HERE, |
| 844 base::Bind(&WritePackToDiskCallback, pack, pack_path)); | 844 base::Bind(&WritePackToDiskCallback, base::RetainedRef(pack), pack_path)); |
| 845 | 845 |
| 846 // Save only the extension path. The packed file which matches the | 846 // Save only the extension path. The packed file which matches the |
| 847 // MaterialDesignController::Mode will be loaded via LoadThemePrefs(). | 847 // MaterialDesignController::Mode will be loaded via LoadThemePrefs(). |
| 848 SavePackName(extension->path()); | 848 SavePackName(extension->path()); |
| 849 SwapThemeSupplier(pack); | 849 SwapThemeSupplier(pack); |
| 850 } | 850 } |
| 851 | 851 |
| 852 #if defined(ENABLE_SUPERVISED_USERS) | 852 #if defined(ENABLE_SUPERVISED_USERS) |
| 853 bool ThemeService::IsSupervisedUser() const { | 853 bool ThemeService::IsSupervisedUser() const { |
| 854 return profile_->IsSupervised(); | 854 return profile_->IsSupervised(); |
| 855 } | 855 } |
| 856 | 856 |
| 857 void ThemeService::SetSupervisedUserTheme() { | 857 void ThemeService::SetSupervisedUserTheme() { |
| 858 SetCustomDefaultTheme(new SupervisedUserTheme); | 858 SetCustomDefaultTheme(new SupervisedUserTheme); |
| 859 } | 859 } |
| 860 #endif | 860 #endif |
| OLD | NEW |