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

Side by Side Diff: chrome/browser/policy/javascript_policy_handler.cc

Issue 385263004: Get rid of some uses of CreateIntegerValue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 | Annotate | Revision Log
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/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
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
OLDNEW
« no previous file with comments | « chrome/browser/policy/cloud/cloud_policy_browsertest.cc ('k') | chrome/browser/policy/javascript_policy_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698