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

Unified Diff: chrome/browser/themes/browser_theme_pack.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/printing/print_dialog_cloud.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/themes/browser_theme_pack.cc
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc
index 5bfcd880a8192c99c01dc8c9586eea5689cf5cab..95945b46a17a117ba6ba66ac3c076d2b45ad743f 100644
--- a/chrome/browser/themes/browser_theme_pack.cc
+++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -298,21 +298,6 @@ RefCountedMemory* ReadFileData(const FilePath& path) {
return NULL;
}
-// Does error checking for invalid incoming data while trying to read an
-// floating point value.
-bool ValidDoubleValue(ListValue* tint_list, int index, double* out) {
- if (tint_list->GetDouble(index, out))
- return true;
-
- int value = 0;
- if (tint_list->GetInteger(index, &value)) {
- *out = value;
- return true;
- }
-
- return false;
-}
-
// Shifts a bitmap's HSL values. The caller is responsible for deleting
// the returned image.
gfx::Image* CreateHSLShiftedImage(const gfx::Image& image,
@@ -646,9 +631,9 @@ void BrowserThemePack::BuildTintsFromJSON(DictionaryValue* tints_value) {
(tint_list->GetSize() == 3)) {
color_utils::HSL hsl = { -1, -1, -1 };
- if (ValidDoubleValue(tint_list, 0, &hsl.h) &&
- ValidDoubleValue(tint_list, 1, &hsl.s) &&
- ValidDoubleValue(tint_list, 2, &hsl.l)) {
+ if (tint_list->GetDouble(0, &hsl.h) &&
+ tint_list->GetDouble(1, &hsl.s) &&
+ tint_list->GetDouble(2, &hsl.l)) {
int id = GetIntForString(*iter, kTintTable);
if (id != -1) {
temp_tints[id] = hsl;
« no previous file with comments | « chrome/browser/printing/print_dialog_cloud.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698