summaryrefslogtreecommitdiffstats
path: root/chrome/browser/themes
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/themes')
-rw-r--r--chrome/browser/themes/browser_theme_pack.cc22
-rw-r--r--chrome/browser/themes/browser_theme_pack_unittest.cc38
-rw-r--r--chrome/browser/themes/theme_syncable_service_unittest.cc4
3 files changed, 33 insertions, 31 deletions
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc
index 2fdec03..0750d64 100644
--- a/chrome/browser/themes/browser_theme_pack.cc
+++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -965,9 +965,9 @@ void BrowserThemePack::BuildTintsFromJSON(
// Parse the incoming data from |tints_value| into an intermediary structure.
std::map<int, color_utils::HSL> temp_tints;
- for (DictionaryValue::Iterator iter(*tints_value); !iter.IsAtEnd();
+ for (base::DictionaryValue::Iterator iter(*tints_value); !iter.IsAtEnd();
iter.Advance()) {
- const ListValue* tint_list;
+ const base::ListValue* tint_list;
if (iter.value().GetAsList(&tint_list) &&
(tint_list->GetSize() == 3)) {
color_utils::HSL hsl = { -1, -1, -1 };
@@ -1022,9 +1022,9 @@ void BrowserThemePack::ReadColorsFromJSON(
const base::DictionaryValue* colors_value,
std::map<int, SkColor>* temp_colors) {
// Parse the incoming data from |colors_value| into an intermediary structure.
- for (DictionaryValue::Iterator iter(*colors_value); !iter.IsAtEnd();
+ for (base::DictionaryValue::Iterator iter(*colors_value); !iter.IsAtEnd();
iter.Advance()) {
- const ListValue* color_list;
+ const base::ListValue* color_list;
if (iter.value().GetAsList(&color_list) &&
((color_list->GetSize() == 3) || (color_list->GetSize() == 4))) {
SkColor color = SK_ColorWHITE;
@@ -1125,7 +1125,7 @@ void BrowserThemePack::BuildDisplayPropertiesFromJSON(
return;
std::map<int, int> temp_properties;
- for (DictionaryValue::Iterator iter(*display_properties_value);
+ for (base::DictionaryValue::Iterator iter(*display_properties_value);
!iter.IsAtEnd(); iter.Advance()) {
int property_id = GetIntForString(iter.key(), kDisplayProperties,
kDisplayPropertiesSize);
@@ -1172,18 +1172,18 @@ void BrowserThemePack::ParseImageNamesFromJSON(
if (!images_value)
return;
- for (DictionaryValue::Iterator iter(*images_value); !iter.IsAtEnd();
+ for (base::DictionaryValue::Iterator iter(*images_value); !iter.IsAtEnd();
iter.Advance()) {
- if (iter.value().IsType(Value::TYPE_DICTIONARY)) {
- const DictionaryValue* inner_value = NULL;
+ if (iter.value().IsType(base::Value::TYPE_DICTIONARY)) {
+ const base::DictionaryValue* inner_value = NULL;
if (iter.value().GetAsDictionary(&inner_value)) {
- for (DictionaryValue::Iterator inner_iter(*inner_value);
+ for (base::DictionaryValue::Iterator inner_iter(*inner_value);
!inner_iter.IsAtEnd();
inner_iter.Advance()) {
std::string name;
ui::ScaleFactor scale_factor = ui::SCALE_FACTOR_NONE;
if (GetScaleFactorFromManifestKey(inner_iter.key(), &scale_factor) &&
- inner_iter.value().IsType(Value::TYPE_STRING) &&
+ inner_iter.value().IsType(base::Value::TYPE_STRING) &&
inner_iter.value().GetAsString(&name)) {
AddFileAtScaleToMap(iter.key(),
scale_factor,
@@ -1192,7 +1192,7 @@ void BrowserThemePack::ParseImageNamesFromJSON(
}
}
}
- } else if (iter.value().IsType(Value::TYPE_STRING)) {
+ } else if (iter.value().IsType(base::Value::TYPE_STRING)) {
std::string name;
if (iter.value().GetAsString(&name)) {
AddFileAtScaleToMap(iter.key(),
diff --git a/chrome/browser/themes/browser_theme_pack_unittest.cc b/chrome/browser/themes/browser_theme_pack_unittest.cc
index 7d41e55..62797ce 100644
--- a/chrome/browser/themes/browser_theme_pack_unittest.cc
+++ b/chrome/browser/themes/browser_theme_pack_unittest.cc
@@ -94,45 +94,46 @@ class BrowserThemePackTest : public ::testing::Test {
}
void LoadColorJSON(const std::string& json) {
- scoped_ptr<Value> value(base::JSONReader::Read(json));
- ASSERT_TRUE(value->IsType(Value::TYPE_DICTIONARY));
- LoadColorDictionary(static_cast<DictionaryValue*>(value.get()));
+ scoped_ptr<base::Value> value(base::JSONReader::Read(json));
+ ASSERT_TRUE(value->IsType(base::Value::TYPE_DICTIONARY));
+ LoadColorDictionary(static_cast<base::DictionaryValue*>(value.get()));
}
- void LoadColorDictionary(DictionaryValue* value) {
+ void LoadColorDictionary(base::DictionaryValue* value) {
theme_pack_->BuildColorsFromJSON(value);
}
void LoadTintJSON(const std::string& json) {
- scoped_ptr<Value> value(base::JSONReader::Read(json));
- ASSERT_TRUE(value->IsType(Value::TYPE_DICTIONARY));
- LoadTintDictionary(static_cast<DictionaryValue*>(value.get()));
+ scoped_ptr<base::Value> value(base::JSONReader::Read(json));
+ ASSERT_TRUE(value->IsType(base::Value::TYPE_DICTIONARY));
+ LoadTintDictionary(static_cast<base::DictionaryValue*>(value.get()));
}
- void LoadTintDictionary(DictionaryValue* value) {
+ void LoadTintDictionary(base::DictionaryValue* value) {
theme_pack_->BuildTintsFromJSON(value);
}
void LoadDisplayPropertiesJSON(const std::string& json) {
- scoped_ptr<Value> value(base::JSONReader::Read(json));
- ASSERT_TRUE(value->IsType(Value::TYPE_DICTIONARY));
- LoadDisplayPropertiesDictionary(static_cast<DictionaryValue*>(value.get()));
+ scoped_ptr<base::Value> value(base::JSONReader::Read(json));
+ ASSERT_TRUE(value->IsType(base::Value::TYPE_DICTIONARY));
+ LoadDisplayPropertiesDictionary(
+ static_cast<base::DictionaryValue*>(value.get()));
}
- void LoadDisplayPropertiesDictionary(DictionaryValue* value) {
+ void LoadDisplayPropertiesDictionary(base::DictionaryValue* value) {
theme_pack_->BuildDisplayPropertiesFromJSON(value);
}
void ParseImageNamesJSON(const std::string& json,
TestFilePathMap* out_file_paths) {
- scoped_ptr<Value> value(base::JSONReader::Read(json));
- ASSERT_TRUE(value->IsType(Value::TYPE_DICTIONARY));
- ParseImageNamesDictionary(static_cast<DictionaryValue*>(value.get()),
+ scoped_ptr<base::Value> value(base::JSONReader::Read(json));
+ ASSERT_TRUE(value->IsType(base::Value::TYPE_DICTIONARY));
+ ParseImageNamesDictionary(static_cast<base::DictionaryValue*>(value.get()),
out_file_paths);
}
void ParseImageNamesDictionary(
- DictionaryValue* value,
+ base::DictionaryValue* value,
TestFilePathMap* out_file_paths) {
theme_pack_->ParseImageNamesFromJSON(value, base::FilePath(),
out_file_paths);
@@ -154,8 +155,9 @@ class BrowserThemePackTest : public ::testing::Test {
extension_path.AppendASCII("manifest.json");
std::string error;
JSONFileValueSerializer serializer(manifest_path);
- scoped_ptr<DictionaryValue> valid_value(
- static_cast<DictionaryValue*>(serializer.Deserialize(NULL, &error)));
+ scoped_ptr<base::DictionaryValue> valid_value(
+ static_cast<base::DictionaryValue*>(
+ serializer.Deserialize(NULL, &error)));
EXPECT_EQ("", error);
ASSERT_TRUE(valid_value.get());
scoped_refptr<Extension> extension(
diff --git a/chrome/browser/themes/theme_syncable_service_unittest.cc b/chrome/browser/themes/theme_syncable_service_unittest.cc
index 41532c3..c1af3fb 100644
--- a/chrome/browser/themes/theme_syncable_service_unittest.cc
+++ b/chrome/browser/themes/theme_syncable_service_unittest.cc
@@ -148,9 +148,9 @@ scoped_refptr<extensions::Extension> MakeThemeExtension(
const string& name,
extensions::Manifest::Location location,
const string& update_url) {
- DictionaryValue source;
+ base::DictionaryValue source;
source.SetString(extensions::manifest_keys::kName, name);
- source.Set(extensions::manifest_keys::kTheme, new DictionaryValue());
+ source.Set(extensions::manifest_keys::kTheme, new base::DictionaryValue());
source.SetString(extensions::manifest_keys::kUpdateURL, update_url);
source.SetString(extensions::manifest_keys::kVersion, "0.0.0.0");
string error;