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

Side by Side Diff: chrome/browser/sessions/restore_on_startup_policy_handler.cc

Issue 2921903002: Remove handling of ClearSiteDataOnExit policy (Closed)
Patch Set: Remove unit test Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/sessions/restore_on_startup_policy_handler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/sessions/restore_on_startup_policy_handler.h" 5 #include "chrome/browser/sessions/restore_on_startup_policy_handler.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/prefs/session_startup_pref.h" 9 #include "chrome/browser/prefs/session_startup_pref.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // session is not cleared so we have to warn the user in that case. 57 // session is not cleared so we have to warn the user in that case.
58 const base::Value* cookies_policy = 58 const base::Value* cookies_policy =
59 policies.GetValue(key::kCookiesSessionOnlyForUrls); 59 policies.GetValue(key::kCookiesSessionOnlyForUrls);
60 const base::ListValue* cookies_value; 60 const base::ListValue* cookies_value;
61 if (cookies_policy && cookies_policy->GetAsList(&cookies_value) && 61 if (cookies_policy && cookies_policy->GetAsList(&cookies_value) &&
62 !cookies_value->empty()) { 62 !cookies_value->empty()) {
63 errors->AddError(key::kCookiesSessionOnlyForUrls, 63 errors->AddError(key::kCookiesSessionOnlyForUrls,
64 IDS_POLICY_OVERRIDDEN, 64 IDS_POLICY_OVERRIDDEN,
65 key::kRestoreOnStartup); 65 key::kRestoreOnStartup);
66 } 66 }
67
68 const base::Value* exit_policy =
69 policies.GetValue(key::kClearSiteDataOnExit);
70 bool exit_value;
71 if (exit_policy && exit_policy->GetAsBoolean(&exit_value) &&
72 exit_value) {
73 errors->AddError(key::kClearSiteDataOnExit,
74 IDS_POLICY_OVERRIDDEN,
75 key::kRestoreOnStartup);
76 }
77 break; 67 break;
78 } 68 }
79 case SessionStartupPref::kPrefValueURLs: 69 case SessionStartupPref::kPrefValueURLs:
80 case SessionStartupPref::kPrefValueNewTab: 70 case SessionStartupPref::kPrefValueNewTab:
81 // No error 71 // No error
82 break; 72 break;
83 default: 73 default:
84 errors->AddError(policy_name(), 74 errors->AddError(policy_name(),
85 IDS_POLICY_OUT_OF_RANGE_ERROR, 75 IDS_POLICY_OUT_OF_RANGE_ERROR,
86 base::IntToString(restore_value)); 76 base::IntToString(restore_value));
87 } 77 }
88 } 78 }
89 return true; 79 return true;
90 } 80 }
91 81
92 } // namespace policy 82 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sessions/restore_on_startup_policy_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698