| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
key::kAIModeSettings);`SearchContentSharingSettings`
CHECK(legacy_details) << "legacy policy details cannot be found.";I agree that legacy policy name should be in the `gen_ai_policies` list.
However, new policies don't have to. And they don't need to share the exact same pref map. For legacy policy, all it needs is that if itself nor the new policy is set, use the default value.
CHECK(new_details) << "new policy details cannot be found.";Follow up of comments above.
Given that we only care about that legacy policy names should be in the `gen_ai_policies` . I suggested to expand `GenAiPolicyDetails` instead of creating the `DeprecatingPolicyDetailsInfo`.
For example:
```
struct POLICY_EXPORT GenAiPolicyDetails {
...
std::string name;
std::string pref_path;
// Another policy that can also set `pref_path` and has higher priority.
std::string overriden_name
```
for (const auto& info : deprecating_policy_details_info_) {If `GenAIDefaultSettings` doesn't control a legacy policy value because the associated new policy is set. We should remove the legacy policy name from the string list above (line 208-210).
While the deprecation message should belong to the legacy policy itself not `GenAIDefaultSettings`. And deprecation message should be generated use `SimpleDeprecatingPolicyHandler` between legacy/new policy.
The policy handler here should focus on applying the default value.
std::optional<GenAiPolicyDetails> effective_policy_details =This is a bit overcomplicated.
`GenAiDefaultSettingsPolicyHandler` handles the case when policies are not set and it should only focus on this case.
For the cases the either the legacy or new policy is set. It should be resolved by the legacy policy handler but not here.
GetValueToApply(*effective_policy_details, policies, default_int_value);`GetValueToApply` is the key function for the policy handler here. What it does is
1) If policy is set, return `null_ptr`
2) If policy is not set, get the default value.
3) Convert default value based on `pref_map` if exists.
4) Return default value.
And what we want is expand the first step.
1) If policy is set, return `null_ptr`
2) If new policy is set, return `null_ptr`
All rest can be skipped.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |