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

Unified Diff: chrome/browser/printing/print_dialog_cloud.cc

Issue 6901084: Use new APIs in base/values.h: Value::GetAsNumber and DictionaryValue::GetNumber. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, 2010->2011 Created 9 years, 8 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
« no previous file with comments | « chrome/browser/extensions/extension_tts_api_util.cc ('k') | chrome/browser/themes/browser_theme_pack.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_dialog_cloud.cc
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc
index 83f94e51f1fe48415fd4d97fa6665fdbfedc19e7..64c2fea782080f70ad6dc44cccf33939b2d19428 100644
--- a/chrome/browser/printing/print_dialog_cloud.cc
+++ b/chrome/browser/printing/print_dialog_cloud.cc
@@ -99,18 +99,6 @@
namespace internal_cloud_print_helpers {
-bool GetDoubleOrInt(const DictionaryValue& dictionary,
- const std::string& path,
- double* out_value) {
- if (!dictionary.GetDouble(path, out_value)) {
- int int_value = 0;
- if (!dictionary.GetInteger(path, &int_value))
- return false;
- *out_value = int_value;
- }
- return true;
-}
-
// From the JSON parsed value, get the entries for the page setup
// parameters.
bool GetPageSetupParameters(const std::string& json,
@@ -124,9 +112,9 @@ bool GetPageSetupParameters(const std::string& json,
bool result = true;
DictionaryValue* params = static_cast<DictionaryValue*>(parsed_value.get());
- result &= GetDoubleOrInt(*params, "dpi", &parameters.dpi);
- result &= GetDoubleOrInt(*params, "min_shrink", &parameters.min_shrink);
- result &= GetDoubleOrInt(*params, "max_shrink", &parameters.max_shrink);
+ result &= params->GetDouble("dpi", &parameters.dpi);
+ result &= params->GetDouble("min_shrink", &parameters.min_shrink);
+ result &= params->GetDouble("max_shrink", &parameters.max_shrink);
result &= params->GetBoolean("selection_only", &parameters.selection_only);
return result;
}
« no previous file with comments | « chrome/browser/extensions/extension_tts_api_util.cc ('k') | chrome/browser/themes/browser_theme_pack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698