Chromium Code Reviews| Index: chrome/browser/sessions/restore_on_startup_policy_handler.cc |
| diff --git a/chrome/browser/sessions/restore_on_startup_policy_handler.cc b/chrome/browser/sessions/restore_on_startup_policy_handler.cc |
| index 4e9a2d4eec1ea3a6675a0b365859f3051cec3c70..64e34b800343debd60759c45783ab2b2772213b0 100644 |
| --- a/chrome/browser/sessions/restore_on_startup_policy_handler.cc |
| +++ b/chrome/browser/sessions/restore_on_startup_policy_handler.cc |
| @@ -33,44 +33,7 @@ void RestoreOnStartupPolicyHandler::ApplyPolicySettings( |
| if (!restore_on_startup_value->GetAsInteger(&restore_on_startup)) |
| return; |
| - if (restore_on_startup == SessionStartupPref::kPrefValueHomePage) |
| - ApplyPolicySettingsFromHomePage(policies, prefs); |
| - else |
| - prefs->SetInteger(prefs::kRestoreOnStartup, restore_on_startup); |
| - } |
| -} |
| - |
| -void RestoreOnStartupPolicyHandler::ApplyPolicySettingsFromHomePage( |
| - const PolicyMap& policies, |
| - PrefValueMap* prefs) { |
| - const base::Value* homepage_is_new_tab_page_value = |
| - policies.GetValue(key::kHomepageIsNewTabPage); |
| - if (!homepage_is_new_tab_page_value) { |
| - // The policy is enforcing 'open the homepage on startup' but not |
| - // enforcing what the homepage should be. Don't set any prefs. |
| - return; |
| - } |
| - |
| - bool homepage_is_new_tab_page; |
| - if (!homepage_is_new_tab_page_value->GetAsBoolean(&homepage_is_new_tab_page)) |
| - return; |
| - |
| - if (homepage_is_new_tab_page) { |
| - prefs->SetInteger(prefs::kRestoreOnStartup, |
| - SessionStartupPref::kPrefValueNewTab); |
| - } else { |
| - const base::Value* homepage_value = |
| - policies.GetValue(key::kHomepageLocation); |
| - if (!homepage_value || !homepage_value->IsType(base::Value::TYPE_STRING)) { |
| - // The policy is enforcing 'open the homepage on startup' but not |
| - // enforcing what the homepage should be. Don't set any prefs. |
| - return; |
| - } |
| - scoped_ptr<base::ListValue> url_list(new base::ListValue()); |
| - url_list->Append(homepage_value->CreateDeepCopy()); |
| - prefs->SetInteger(prefs::kRestoreOnStartup, |
| - SessionStartupPref::kPrefValueURLs); |
| - prefs->SetValue(prefs::kURLsToRestoreOnStartup, url_list.Pass()); |
| + prefs->SetInteger(prefs::kRestoreOnStartup, restore_on_startup); |
| } |
| } |
| @@ -86,9 +49,6 @@ bool RestoreOnStartupPolicyHandler::CheckPolicySettings( |
| int restore_value; |
| CHECK(restore_policy->GetAsInteger(&restore_value)); // Passed type check. |
| switch (restore_value) { |
| - case SessionStartupPref::kPrefValueHomePage: |
| - errors->AddError(policy_name(), IDS_POLICY_VALUE_DEPRECATED); |
|
bartfab (slow)
2015/08/31 15:36:43
Please remove the string from components/policy_st
sdefresne
2015/09/02 11:30:19
Done.
|
| - break; |
| case SessionStartupPref::kPrefValueLast: { |
| // If the "restore last session" policy is set, session cookies are |
| // treated as permanent cookies and site data needed to restore the |