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

Unified Diff: chrome/browser/ui/webui/options/core_options_handler.cc

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/core_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc
index b0853c49bbac7947e742ffc4ce439dd1927785e3..f74c4d51c5c9c978aa3e5de1a403d3f77abf7ce0 100644
--- a/chrome/browser/ui/webui/options/core_options_handler.cc
+++ b/chrome/browser/ui/webui/options/core_options_handler.cc
@@ -204,7 +204,7 @@ void CoreOptionsHandler::ProcessUserMetric(const Value* value,
return;
std::string metric_string = metric;
- if (value->IsType(Value::TYPE_BOOLEAN)) {
+ if (value->IsBoolean()) {
bool bool_value;
CHECK(value->GetAsBoolean(&bool_value));
metric_string += bool_value ? "_Enable" : "_Disable";
@@ -224,7 +224,7 @@ void CoreOptionsHandler::HandleFetchPrefs(const ListValue* args) {
// Get callback JS function name.
Value* callback;
- if (!args->Get(0, &callback) || !callback->IsType(Value::TYPE_STRING))
+ if (!args->Get(0, &callback) || !callback->IsString())
return;
string16 callback_function;
@@ -239,7 +239,7 @@ void CoreOptionsHandler::HandleFetchPrefs(const ListValue* args) {
if (!args->Get(i, &list_member))
break;
- if (!list_member->IsType(Value::TYPE_STRING))
+ if (!list_member->IsString())
continue;
std::string pref_name;
@@ -270,8 +270,7 @@ void CoreOptionsHandler::HandleObservePrefs(const ListValue* args) {
// Just ignore bad pref identifiers for now.
std::string pref_name;
- if (!list_member->IsType(Value::TYPE_STRING) ||
- !list_member->GetAsString(&pref_name))
+ if (!list_member->IsString() || !list_member->GetAsString(&pref_name))
continue;
if (pref_callback_map_.find(pref_name) == pref_callback_map_.end())
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc ('k') | chrome/browser/ui/webui/print_preview_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698