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

Side by Side Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 11415226: webui/options: Do not use Value::CreateStringValue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/options/content_settings_handler.h" 5 #include "chrome/browser/ui/webui/options/content_settings_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 ExContentSettingsType type = ExContentSettingsTypeFromGroupName(type_string); 1239 ExContentSettingsType type = ExContentSettingsTypeFromGroupName(type_string);
1240 bool is_valid = false; 1240 bool is_valid = false;
1241 if (type == EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC) { 1241 if (type == EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC) {
1242 is_valid = IsValidHost(pattern_string); 1242 is_valid = IsValidHost(pattern_string);
1243 } else { 1243 } else {
1244 ContentSettingsPattern pattern = 1244 ContentSettingsPattern pattern =
1245 ContentSettingsPattern::FromString(pattern_string); 1245 ContentSettingsPattern::FromString(pattern_string);
1246 is_valid = pattern.IsValid(); 1246 is_valid = pattern.IsValid();
1247 } 1247 }
1248 1248
1249 scoped_ptr<Value> type_value(Value::CreateStringValue(type_string)); 1249 scoped_ptr<Value> type_value(new base::StringValue(type_string));
Evan Stade 2012/11/30 20:15:56 these do not need to be scoped pointers. You can j
tfarina 2012/11/30 22:41:08 Done.
1250 scoped_ptr<Value> mode_value(Value::CreateStringValue(mode_string)); 1250 scoped_ptr<Value> mode_value(new base::StringValue(mode_string));
1251 scoped_ptr<Value> pattern_value(Value::CreateStringValue(pattern_string)); 1251 scoped_ptr<Value> pattern_value(new base::StringValue(pattern_string));
1252 scoped_ptr<Value> valid_value(Value::CreateBooleanValue(is_valid)); 1252 scoped_ptr<Value> valid_value(Value::CreateBooleanValue(is_valid));
1253 1253
1254 web_ui()->CallJavascriptFunction( 1254 web_ui()->CallJavascriptFunction(
1255 "ContentSettings.patternValidityCheckComplete", 1255 "ContentSettings.patternValidityCheckComplete",
1256 *type_value.get(), 1256 *type_value.get(),
1257 *mode_value.get(), 1257 *mode_value.get(),
1258 *pattern_value.get(), 1258 *pattern_value.get(),
1259 *valid_value.get()); 1259 *valid_value.get());
1260 } 1260 }
1261 1261
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { 1312 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) {
1313 if (type == kExContentSettingsTypeGroupNames[i].type) 1313 if (type == kExContentSettingsTypeGroupNames[i].type)
1314 return kExContentSettingsTypeGroupNames[i].name; 1314 return kExContentSettingsTypeGroupNames[i].name;
1315 } 1315 }
1316 1316
1317 NOTREACHED(); 1317 NOTREACHED();
1318 return std::string(); 1318 return std::string();
1319 } 1319 }
1320 1320
1321 } // namespace options 1321 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698