Find a way to check if a profile has policy for const Profile*. Use it in IsArcMigrationAllowedInternal (through IsAccountManaged).
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b68b901905129e3b1696cfa529d7fcf5a08de646 commit b68b901905129e3b1696cfa529d7fcf5a08de646 Author: Pavol Marko <pmarko@chromium.org> Date: Fri Nov 03 10:18:59 2017 Allow IsManaged check on const Profile* Wire up const methods to be able to check if a const Profile* is managed. The main piece is introducing a ProfilePolicyConnectorFactory::IsProfileManaged which accepts a const pointer argument. Internally, it accesses the already-existing ProfilePolicyConnector and CHECK-fails if it hasn't been created yet. However, we don't surface a getter/factory method to retrieve a ProfilePolicyConnector* for a const Profile* to the outside to make sure that we don't put unnecessary constraints on future changes in the factory class. BUG= 771666 Change-Id: Ia4ec9ee42b54006602c537ae6995f85a9ca571c7 Reviewed-on: https://chromium-review.googlesource.com/702425 Reviewed-by: anthonyvd <anthonyvd@chromium.org> Reviewed-by: John Abd-El-Malek <jam@chromium.org> Reviewed-by: Maksim Ivanov <emaxx@chromium.org> Commit-Queue: Pavol Marko <pmarko@chromium.org> Cr-Commit-Position: refs/heads/master@{#513735} [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/chromeos/arc/arc_util.cc [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/chromeos/arc/arc_util_unittest.cc [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/chromeos/arc/policy/arc_policy_util.cc [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/chromeos/arc/policy/arc_policy_util.h [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/policy/profile_policy_connector_factory.cc [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/policy/profile_policy_connector_factory.h [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/profiles/incognito_helpers.cc [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/profiles/incognito_helpers.h [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/profiles/off_the_record_profile_impl.cc [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/profiles/off_the_record_profile_impl.h [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/profiles/profile.h [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/profiles/profile_impl.cc [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/profiles/profile_impl.h [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/ui/app_list/test/fake_profile.cc [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/browser/ui/app_list/test/fake_profile.h [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/test/base/testing_profile.cc [modify] https://crrev.com/b68b901905129e3b1696cfa529d7fcf5a08de646/chrome/test/base/testing_profile.h
Setting to verified as this was a small refactoring and there is nothing more to verify here.
Comment 1 by pmarko@chromium.org
, Oct 9 2017