| OLD | NEW |
| 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/policy/javascript_policy_handler.h" | 5 #include "chrome/browser/policy/javascript_policy_handler.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_value_map.h" | 7 #include "base/prefs/pref_value_map.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/common/content_settings.h" | 9 #include "chrome/common/content_settings.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 const base::Value* javascript_enabled = | 60 const base::Value* javascript_enabled = |
| 61 policies.GetValue(key::kJavascriptEnabled); | 61 policies.GetValue(key::kJavascriptEnabled); |
| 62 bool enabled = true; | 62 bool enabled = true; |
| 63 if (javascript_enabled && | 63 if (javascript_enabled && |
| 64 javascript_enabled->GetAsBoolean(&enabled) && | 64 javascript_enabled->GetAsBoolean(&enabled) && |
| 65 !enabled) { | 65 !enabled) { |
| 66 setting = CONTENT_SETTING_BLOCK; | 66 setting = CONTENT_SETTING_BLOCK; |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 if (setting != CONTENT_SETTING_DEFAULT) { | 70 if (setting != CONTENT_SETTING_DEFAULT) |
| 71 prefs->SetValue(prefs::kManagedDefaultJavaScriptSetting, | 71 prefs->SetInteger(prefs::kManagedDefaultJavaScriptSetting, setting); |
| 72 base::Value::CreateIntegerValue(setting)); | |
| 73 } | |
| 74 } | 72 } |
| 75 | 73 |
| 76 } // namespace policy | 74 } // namespace policy |
| OLD | NEW |