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

Unified Diff: chrome/browser/chromeos/ownership/owner_settings_service.cc

Issue 494093002: OwnerKeyUtil is moved to components/ownership. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/ownership/owner_settings_service.cc
diff --git a/chrome/browser/chromeos/ownership/owner_settings_service.cc b/chrome/browser/chromeos/ownership/owner_settings_service.cc
index 9b4ccef7175695c57ef080ab9cee70b54eb5fb89..b321596349e4e6c758701c5306b994ec7597141a 100644
--- a/chrome/browser/chromeos/ownership/owner_settings_service.cc
+++ b/chrome/browser/chromeos/ownership/owner_settings_service.cc
@@ -9,12 +9,15 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
+#include "base/path_service.h"
+#include "base/prefs/pref_service.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/settings/session_manager_operation.h"
#include "chrome/browser/profiles/profile.h"
+#include "chromeos/chromeos_paths.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "content/public/browser/browser_thread.h"
@@ -31,6 +34,9 @@
namespace em = enterprise_management;
using content::BrowserThread;
+using ownership::OwnerKeyUtil;
+using ownership::PrivateKey;
+using ownership::PublicKey;
namespace chromeos {
@@ -39,6 +45,13 @@ namespace {
scoped_refptr<OwnerKeyUtil>* g_owner_key_util_for_testing = NULL;
DeviceSettingsService* g_device_settings_service_for_testing = NULL;
+scoped_refptr<ownership::OwnerKeyUtil> MakeOwnerKeyUtil() {
+ base::FilePath public_key_path;
+ if (!PathService::Get(chromeos::FILE_OWNER_KEY, &public_key_path))
+ return NULL;
+ return OwnerKeyUtil::Create(public_key_path);
+}
stevenjb 2014/08/26 16:02:12 So, while I do like removing the reference to chro
ygorshenin1 2014/08/26 16:31:16 Done.
+
bool IsOwnerInTests(const std::string& user_id) {
if (user_id.empty() ||
!CommandLine::ForCurrentProcess()->HasSwitch(::switches::kTestType) ||
@@ -176,7 +189,11 @@ void DoesPrivateKeyExistAsync(
if (g_owner_key_util_for_testing)
owner_key_util = *g_owner_key_util_for_testing;
else
- owner_key_util = OwnerKeyUtil::Create();
+ owner_key_util = MakeOwnerKeyUtil();
+ if (!owner_key_util) {
+ callback.Run(false);
+ return;
+ }
scoped_refptr<base::TaskRunner> task_runner =
content::BrowserThread::GetBlockingPool()
->GetTaskRunnerWithShutdownBehavior(
@@ -232,7 +249,7 @@ bool CheckManagementModeTransition(em::PolicyData::ManagementMode current_mode,
OwnerSettingsService::OwnerSettingsService(Profile* profile)
: profile_(profile),
- owner_key_util_(OwnerKeyUtil::Create()),
+ owner_key_util_(MakeOwnerKeyUtil()),
waiting_for_profile_creation_(true),
waiting_for_tpm_token_(true),
weak_factory_(this) {

Powered by Google App Engine
This is Rietveld 408576698