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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 if (!service) | 762 if (!service) |
763 return; | 763 return; |
764 | 764 |
765 // Write the packed file to disk. | 765 // Write the packed file to disk. |
766 base::FilePath pack_path = | 766 base::FilePath pack_path = |
767 extension->path().Append(ui::MaterialDesignController::IsModeMaterial() | 767 extension->path().Append(ui::MaterialDesignController::IsModeMaterial() |
768 ? chrome::kThemePackMaterialDesignFilename | 768 ? chrome::kThemePackMaterialDesignFilename |
769 : chrome::kThemePackFilename); | 769 : chrome::kThemePackFilename); |
770 service->GetFileTaskRunner()->PostTask( | 770 service->GetFileTaskRunner()->PostTask( |
771 FROM_HERE, | 771 FROM_HERE, |
772 base::Bind(&WritePackToDiskCallback, pack, pack_path)); | 772 base::Bind(&WritePackToDiskCallback, base::RetainedRef(pack), pack_path)); |
773 | 773 |
774 // Save only the extension path. The packed file which matches the | 774 // Save only the extension path. The packed file which matches the |
775 // MaterialDesignController::Mode will be loaded via LoadThemePrefs(). | 775 // MaterialDesignController::Mode will be loaded via LoadThemePrefs(). |
776 SavePackName(extension->path()); | 776 SavePackName(extension->path()); |
777 SwapThemeSupplier(pack); | 777 SwapThemeSupplier(pack); |
778 } | 778 } |
779 | 779 |
780 #if defined(ENABLE_SUPERVISED_USERS) | 780 #if defined(ENABLE_SUPERVISED_USERS) |
781 bool ThemeService::IsSupervisedUser() const { | 781 bool ThemeService::IsSupervisedUser() const { |
782 return profile_->IsSupervised(); | 782 return profile_->IsSupervised(); |
783 } | 783 } |
784 | 784 |
785 void ThemeService::SetSupervisedUserTheme() { | 785 void ThemeService::SetSupervisedUserTheme() { |
786 SetCustomDefaultTheme(new SupervisedUserTheme); | 786 SetCustomDefaultTheme(new SupervisedUserTheme); |
787 } | 787 } |
788 #endif | 788 #endif |
OLD | NEW |