| 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/chromeos/system/drm_settings.h" | 5 #include "chrome/browser/chromeos/system/drm_settings.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/chromeos/chromeos_version.h" | 8 #include "base/chromeos/chromeos_version.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 if (!user_manager) | 97 if (!user_manager) |
| 98 return; | 98 return; |
| 99 | 99 |
| 100 // This preference is only meant to be called when a user | 100 // This preference is only meant to be called when a user |
| 101 // is logged in. | 101 // is logged in. |
| 102 if (!user_manager->IsUserLoggedIn()) { | 102 if (!user_manager->IsUserLoggedIn()) { |
| 103 LOG(WARNING) << "Called without a logged in user!"; | 103 LOG(WARNING) << "Called without a logged in user!"; |
| 104 return; | 104 return; |
| 105 } | 105 } |
| 106 | 106 |
| 107 // Don't generate files as a guest, demo user, or a stub. | 107 // Don't generate files as a guest or demo user. |
| 108 if (user_manager->IsLoggedInAsGuest() || | 108 if (user_manager->IsLoggedInAsGuest() || |
| 109 user_manager->IsLoggedInAsDemoUser() || | 109 user_manager->IsLoggedInAsDemoUser()) |
| 110 user_manager->IsLoggedInAsStub()) | |
| 111 return; | 110 return; |
| 112 | 111 |
| 113 // The user email address is included in the hash to keep the identifier | 112 // The user email address is included in the hash to keep the identifier |
| 114 // from being the same across users. | 113 // from being the same across users. |
| 115 std::string email = user_manager->GetLoggedInUser().email(); | 114 std::string email = user_manager->GetLoggedInUser().email(); |
| 116 // If there is no real user then there's nothing to do here. | 115 // If there is no real user then there's nothing to do here. |
| 117 if (email.length() == 0) { | 116 if (email.length() == 0) { |
| 118 LOG(WARNING) << "Unexpected 0 length user email."; | 117 LOG(WARNING) << "Unexpected 0 length user email."; |
| 119 return; | 118 return; |
| 120 } | 119 } |
| 121 | 120 |
| 122 // Generate a DRM identifier on the FILE thread. | 121 // Generate a DRM identifier on the FILE thread. |
| 123 // The DRM identifier is a per-user, per-OS-install identifier that is used | 122 // The DRM identifier is a per-user, per-OS-install identifier that is used |
| 124 // by privileged pepper plugins specifically for deriving | 123 // by privileged pepper plugins specifically for deriving |
| 125 // per-content-provider identifiers. The user must be able to clear it, | 124 // per-content-provider identifiers. The user must be able to clear it, |
| 126 // reset it, and deny its use. | 125 // reset it, and deny its use. |
| 127 BrowserThread::PostTask( | 126 BrowserThread::PostTask( |
| 128 BrowserThread::FILE, FROM_HERE, | 127 BrowserThread::FILE, FROM_HERE, |
| 129 base::Bind(&ManageDrmIdentifierOnFileThread, enable, email)); | 128 base::Bind(&ManageDrmIdentifierOnFileThread, enable, email)); |
| 130 } | 129 } |
| 131 | 130 |
| 132 } // namespace system | 131 } // namespace system |
| 133 } // namespace chromeos | 132 } // namespace chromeos |
| OLD | NEW |