summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/blocked_popup_container.cc14
-rw-r--r--chrome/browser/bookmarks/bookmark_codec_unittest.cc8
-rw-r--r--chrome/browser/browser_theme_provider.cc25
-rw-r--r--chrome/browser/dom_ui/most_visited_handler.cc14
-rw-r--r--chrome/browser/dom_ui/tips_handler.cc2
-rw-r--r--chrome/browser/extensions/execute_code_in_tab_function.cc2
-rw-r--r--chrome/browser/extensions/extension_file_util.cc2
-rw-r--r--chrome/browser/extensions/extension_prefs.cc41
-rw-r--r--chrome/browser/extensions/extension_prefs.h2
-rw-r--r--chrome/browser/extensions/extension_uitest.cc22
-rw-r--r--chrome/browser/extensions/extensions_service_unittest.cc4
-rw-r--r--chrome/browser/extensions/external_pref_extension_provider.cc5
-rw-r--r--chrome/browser/extensions/sandboxed_extension_unpacker.cc6
-rw-r--r--chrome/browser/metrics/metrics_log.cc7
-rw-r--r--chrome/browser/sync/sync_setup_wizard_unittest.cc6
-rw-r--r--chrome/browser/thumbnail_store.cc2
-rw-r--r--chrome/browser/webdata/web_database_unittest.cc4
17 files changed, 77 insertions, 89 deletions
diff --git a/chrome/browser/blocked_popup_container.cc b/chrome/browser/blocked_popup_container.cc
index 2422c2b..e4c2184 100644
--- a/chrome/browser/blocked_popup_container.cc
+++ b/chrome/browser/blocked_popup_container.cc
@@ -391,13 +391,13 @@ BlockedPopupContainer::BlockedPopupContainer(TabContents* owner,
const ListValue* whitelist_pref =
prefs_->GetList(prefs::kPopupWhitelistedHosts);
// Careful: The returned value could be NULL if the pref has never been set.
- if (whitelist_pref != NULL) {
- for (ListValue::const_iterator i(whitelist_pref->begin());
- i != whitelist_pref->end(); ++i) {
- std::string host;
- (*i)->GetAsString(&host);
- whitelist_.insert(host);
- }
+ if (whitelist_pref == NULL)
+ return;
+ for (ListValue::const_iterator i(whitelist_pref->begin());
+ i != whitelist_pref->end(); ++i) {
+ std::string host;
+ (*i)->GetAsString(&host);
+ whitelist_.insert(host);
}
}
diff --git a/chrome/browser/bookmarks/bookmark_codec_unittest.cc b/chrome/browser/bookmarks/bookmark_codec_unittest.cc
index 0ba16a7..8272270 100644
--- a/chrome/browser/bookmarks/bookmark_codec_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_codec_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -202,14 +202,14 @@ TEST_F(BookmarkCodecTest, ChecksumManualEditTest) {
GetBookmarksBarChildValue(value.get(), 0, &child1_value);
std::wstring title;
ASSERT_TRUE(child1_value->GetString(BookmarkCodec::kNameKey, &title));
- ASSERT_TRUE(child1_value->SetString(BookmarkCodec::kNameKey, title + L"1"));
+ child1_value->SetString(BookmarkCodec::kNameKey, title + L"1");
std::string dec_checksum;
scoped_ptr<BookmarkModel> decoded_model1(DecodeHelper(
*value.get(), enc_checksum, &dec_checksum, true));
// Undo the change and make sure the checksum is same as original.
- ASSERT_TRUE(child1_value->SetString(BookmarkCodec::kNameKey, title));
+ child1_value->SetString(BookmarkCodec::kNameKey, title);
scoped_ptr<BookmarkModel> decoded_model2(DecodeHelper(
*value.get(), enc_checksum, &dec_checksum, false));
}
@@ -233,7 +233,7 @@ TEST_F(BookmarkCodecTest, ChecksumManualEditIDsTest) {
GetBookmarksBarChildValue(value.get(), i, &child_value);
std::string id;
ASSERT_TRUE(child_value->GetString(BookmarkCodec::kIdKey, &id));
- ASSERT_TRUE(child_value->SetString(BookmarkCodec::kIdKey, "1"));
+ child_value->SetString(BookmarkCodec::kIdKey, "1");
}
std::string dec_checksum;
diff --git a/chrome/browser/browser_theme_provider.cc b/chrome/browser/browser_theme_provider.cc
index 6bc9e97..be81770 100644
--- a/chrome/browser/browser_theme_provider.cc
+++ b/chrome/browser/browser_theme_provider.cc
@@ -1075,7 +1075,7 @@ void BrowserThemeProvider::SetImageData(DictionaryValue* images_value,
for (DictionaryValue::key_iterator iter(images_value->begin_keys());
iter != images_value->end_keys(); ++iter) {
std::string val;
- if (images_value->GetString(*iter, &val)) {
+ if (images_value->GetStringWithoutPathExpansion(*iter, &val)) {
int id = ThemeResourcesUtil::GetId(WideToUTF8(*iter));
if (id != -1) {
if (!images_path.empty()) {
@@ -1099,7 +1099,7 @@ void BrowserThemeProvider::SetColorData(DictionaryValue* colors_value) {
for (DictionaryValue::key_iterator iter(colors_value->begin_keys());
iter != colors_value->end_keys(); ++iter) {
ListValue* color_list;
- if (colors_value->GetList(*iter, &color_list) &&
+ if (colors_value->GetListWithoutPathExpansion(*iter, &color_list) &&
((color_list->GetSize() == 3) || (color_list->GetSize() == 4))) {
int r, g, b;
color_list->GetInteger(0, &r);
@@ -1132,7 +1132,7 @@ void BrowserThemeProvider::SetTintData(DictionaryValue* tints_value) {
for (DictionaryValue::key_iterator iter(tints_value->begin_keys());
iter != tints_value->end_keys(); ++iter) {
ListValue* tint_list;
- if (tints_value->GetList(*iter, &tint_list) &&
+ if (tints_value->GetListWithoutPathExpansion(*iter, &tint_list) &&
(tint_list->GetSize() == 3)) {
color_utils::HSL hsl = { -1, -1, -1 };
int value = 0;
@@ -1162,22 +1162,21 @@ void BrowserThemeProvider::SetDisplayPropertyData(
if (base::strcasecmp(WideToUTF8(*iter).c_str(),
kDisplayPropertyNTPAlignment) == 0) {
std::string val;
- if (display_properties_value->GetString(*iter, &val)) {
+ if (display_properties_value->GetStringWithoutPathExpansion(*iter,
+ &val)) {
display_properties_[kDisplayPropertyNTPAlignment] =
StringToAlignment(val);
}
} else if (base::strcasecmp(WideToUTF8(*iter).c_str(),
kDisplayPropertyNTPTiling) == 0) {
std::string val;
- if (display_properties_value->GetString(*iter, &val)) {
- display_properties_[kDisplayPropertyNTPTiling] =
- StringToTiling(val);
- }
+ if (display_properties_value->GetStringWithoutPathExpansion(*iter, &val))
+ display_properties_[kDisplayPropertyNTPTiling] = StringToTiling(val);
}
if (base::strcasecmp(WideToUTF8(*iter).c_str(),
kDisplayPropertyNTPInverseLogo) == 0) {
int val = 0;
- if (display_properties_value->GetInteger(*iter, &val))
+ if (display_properties_value->GetIntegerWithoutPathExpansion(*iter, &val))
display_properties_[kDisplayPropertyNTPInverseLogo] = val;
}
}
@@ -1222,10 +1221,12 @@ void BrowserThemeProvider::SaveImageData(DictionaryValue* images_value) const {
for (DictionaryValue::key_iterator iter(images_value->begin_keys());
iter != images_value->end_keys(); ++iter) {
std::string val;
- if (images_value->GetString(*iter, &val)) {
+ if (images_value->GetStringWithoutPathExpansion(*iter, &val)) {
int id = ThemeResourcesUtil::GetId(WideToUTF8(*iter));
- if (id != -1)
- pref_images->SetString(*iter, images_.find(id)->second);
+ if (id != -1) {
+ pref_images->SetWithoutPathExpansion(*iter,
+ Value::CreateStringValue(images_.find(id)->second));
+ }
}
}
}
diff --git a/chrome/browser/dom_ui/most_visited_handler.cc b/chrome/browser/dom_ui/most_visited_handler.cc
index 8901d3f9..853a3c9 100644
--- a/chrome/browser/dom_ui/most_visited_handler.cc
+++ b/chrome/browser/dom_ui/most_visited_handler.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -126,7 +126,7 @@ void MostVisitedHandler::StartQueryForMostVisited() {
// we'll be filtering-out the returned list with the blacklist URLs.
// We do not subtract the number of pinned URLs we have because the
// HistoryService does not know about those.
- const int result_count = page_count + url_blacklist_->GetSize();
+ const int result_count = page_count + url_blacklist_->size();
HistoryService* hs =
dom_ui_->GetProfile()->GetHistoryService(Profile::EXPLICIT_ACCESS);
// |hs| may be null during unit tests.
@@ -230,12 +230,8 @@ void MostVisitedHandler::AddPinnedURL(const MostVisitedPage& page, int index) {
DictionaryValue* new_value = new DictionaryValue();
SetMostVisistedPage(new_value, page);
- bool r = new_value->SetInteger(L"index", index);
- DCHECK(r) << "Failed to set the index for a pinned URL from the NTP Most "
- << "Visited.";
-
- r = pinned_urls_->Set(GetDictionaryKeyForURL(page.url.spec()), new_value);
- DCHECK(r) << "Failed to add pinned URL from the NTP Most Visited.";
+ new_value->SetInteger(L"index", index);
+ pinned_urls_->Set(GetDictionaryKeyForURL(page.url.spec()), new_value);
// TODO(arv): Notify observers?
@@ -276,7 +272,7 @@ const bool MostVisitedHandler::GetPinnedURLAtIndex(const int index,
for (DictionaryValue::key_iterator it = pinned_urls_->begin_keys();
it != pinned_urls_->end_keys(); ++it) {
Value* value;
- if (pinned_urls_->Get(*it, &value)) {
+ if (pinned_urls_->GetWithoutPathExpansion(*it, &value)) {
if (!value->IsType(DictionaryValue::TYPE_DICTIONARY)) {
NOTREACHED();
return false;
diff --git a/chrome/browser/dom_ui/tips_handler.cc b/chrome/browser/dom_ui/tips_handler.cc
index 35d3cc2..ee429f7 100644
--- a/chrome/browser/dom_ui/tips_handler.cc
+++ b/chrome/browser/dom_ui/tips_handler.cc
@@ -52,7 +52,7 @@ void TipsHandler::HandleGetTips(const Value* content) {
}
}
- if (tips_cache_ != NULL && tips_cache_->GetSize() != 0) {
+ if (tips_cache_ != NULL && !tips_cache_->empty()) {
if (tips_cache_->GetInteger(
WebResourceService::kCurrentTipPrefName, &current_tip_index) &&
tips_cache_->GetList(
diff --git a/chrome/browser/extensions/execute_code_in_tab_function.cc b/chrome/browser/extensions/execute_code_in_tab_function.cc
index 3fb0e86..98757d2 100644
--- a/chrome/browser/extensions/execute_code_in_tab_function.cc
+++ b/chrome/browser/extensions/execute_code_in_tab_function.cc
@@ -25,7 +25,7 @@ bool ExecuteCodeInTabFunction::RunImpl() {
DictionaryValue* script_info;
EXTENSION_FUNCTION_VALIDATE(args->GetDictionary(1, &script_info));
- size_t number_of_value = script_info->GetSize();
+ size_t number_of_value = script_info->size();
if (number_of_value == 0) {
error_ = keys::kNoCodeOrFileToExecuteError;
return false;
diff --git a/chrome/browser/extensions/extension_file_util.cc b/chrome/browser/extensions/extension_file_util.cc
index e7ecd08..f61dfef 100644
--- a/chrome/browser/extensions/extension_file_util.cc
+++ b/chrome/browser/extensions/extension_file_util.cc
@@ -169,7 +169,7 @@ bool ValidateExtension(Extension* extension, std::string* error) {
for (DictionaryValue::key_iterator iter = images_value->begin_keys();
iter != images_value->end_keys(); ++iter) {
std::string val;
- if (images_value->GetString(*iter, &val)) {
+ if (images_value->GetStringWithoutPathExpansion(*iter, &val)) {
FilePath image_path = extension->path().AppendASCII(val);
if (!file_util::PathExists(image_path)) {
*error = StringPrintf(
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index d638847..c793fb3b 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -50,10 +50,12 @@ InstalledExtensions::~InstalledExtensions() {
void InstalledExtensions::VisitInstalledExtensions(
InstalledExtensions::Callback *callback) {
scoped_ptr<InstalledExtensions::Callback> cleanup(callback);
- DictionaryValue::key_iterator extension_id = extension_data_->begin_keys();
- for (; extension_id != extension_data_->end_keys(); ++extension_id) {
+ for (DictionaryValue::key_iterator extension_id(
+ extension_data_->begin_keys());
+ extension_id != extension_data_->end_keys(); ++extension_id) {
DictionaryValue* ext;
- if (!extension_data_->GetDictionary(*extension_id, &ext)) {
+ if (!extension_data_->GetDictionaryWithoutPathExpansion(*extension_id,
+ &ext)) {
LOG(WARNING) << "Invalid pref for extension " << *extension_id;
NOTREACHED();
continue;
@@ -125,13 +127,13 @@ static FilePath::StringType MakePathRelative(const FilePath& parent,
void ExtensionPrefs::MakePathsRelative() {
bool dirty = false;
const DictionaryValue* dict = prefs_->GetMutableDictionary(kExtensionsPref);
- if (!dict || dict->GetSize() == 0)
+ if (!dict || dict->empty())
return;
for (DictionaryValue::key_iterator i = dict->begin_keys();
i != dict->end_keys(); ++i) {
DictionaryValue* extension_dict;
- if (!dict->GetDictionary(*i, &extension_dict))
+ if (!dict->GetDictionaryWithoutPathExpansion(*i, &extension_dict))
continue;
FilePath::StringType path_string;
if (!extension_dict->GetString(kPrefPath, &path_string))
@@ -147,13 +149,13 @@ void ExtensionPrefs::MakePathsRelative() {
}
void ExtensionPrefs::MakePathsAbsolute(DictionaryValue* dict) {
- if (!dict || dict->GetSize() == 0)
+ if (!dict || dict->empty())
return;
for (DictionaryValue::key_iterator i = dict->begin_keys();
i != dict->end_keys(); ++i) {
DictionaryValue* extension_dict;
- if (!dict->GetDictionary(*i, &extension_dict)) {
+ if (!dict->GetDictionaryWithoutPathExpansion(*i, &extension_dict)) {
NOTREACHED();
continue;
}
@@ -211,21 +213,21 @@ void ExtensionPrefs::UpdateBlacklist(
std::set<std::string> used_id_set;
const DictionaryValue* extensions = prefs_->GetDictionary(kExtensionsPref);
DCHECK(extensions);
- DictionaryValue::key_iterator extension_id = extensions->begin_keys();
- for (; extension_id != extensions->end_keys(); ++extension_id) {
+ for (DictionaryValue::key_iterator extension_id = extensions->begin_keys();
+ extension_id != extensions->end_keys(); ++extension_id) {
DictionaryValue* ext;
- std::string id = WideToASCII(*extension_id);
- if (!extensions->GetDictionary(*extension_id, &ext)) {
+ if (!extensions->GetDictionaryWithoutPathExpansion(*extension_id, &ext)) {
NOTREACHED() << "Invalid pref for extension " << *extension_id;
continue;
}
+ std::string id = WideToASCII(*extension_id);
if (blacklist_set.find(id) == blacklist_set.end()) {
if (!IsBlacklistBitSet(ext)) {
// This extension is not in blacklist. And it was not blacklisted
// before.
continue;
} else {
- if (ext->GetSize() == 1) {
+ if (ext->size() == 1) {
// We should remove the entry if the only flag here is blacklist.
remove_pref_ids.push_back(id);
} else {
@@ -261,7 +263,7 @@ void ExtensionPrefs::UpdateBlacklist(
void ExtensionPrefs::GetKilledExtensionIds(std::set<std::string>* killed_ids) {
const DictionaryValue* dict = prefs_->GetDictionary(kExtensionsPref);
- if (!dict || dict->GetSize() == 0)
+ if (!dict || dict->empty())
return;
for (DictionaryValue::key_iterator i = dict->begin_keys();
@@ -273,7 +275,7 @@ void ExtensionPrefs::GetKilledExtensionIds(std::set<std::string>* killed_ids) {
continue;
}
- DictionaryValue* extension = NULL;
+ DictionaryValue* extension;
if (!dict->GetDictionary(key_name, &extension)) {
NOTREACHED();
continue;
@@ -391,7 +393,7 @@ void ExtensionPrefs::MigrateToPrefs(Extension* extension) {
FilePath ExtensionPrefs::GetExtensionPath(const std::string& extension_id) {
const DictionaryValue* dict = prefs_->GetDictionary(kExtensionsPref);
- if (!dict || dict->GetSize() == 0)
+ if (!dict || dict->empty())
return FilePath();
std::wstring path;
@@ -401,16 +403,11 @@ FilePath ExtensionPrefs::GetExtensionPath(const std::string& extension_id) {
return install_directory_.Append(FilePath::FromWStringHack(path));
}
-bool ExtensionPrefs::UpdateExtensionPref(const std::string& extension_id,
+void ExtensionPrefs::UpdateExtensionPref(const std::string& extension_id,
const std::wstring& key,
Value* data_value) {
DictionaryValue* extension = GetOrCreateExtensionPref(extension_id);
- if (!extension->Set(key, data_value)) {
- NOTREACHED() << "Cannot modify key: '" << key.c_str()
- << "' for extension: '" << extension_id.c_str() << "'";
- return false;
- }
- return true;
+ extension->Set(key, data_value);
}
void ExtensionPrefs::DeleteExtensionPrefs(const std::string& extension_id) {
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h
index 11c7e31..2bbd239 100644
--- a/chrome/browser/extensions/extension_prefs.h
+++ b/chrome/browser/extensions/extension_prefs.h
@@ -79,7 +79,7 @@ class ExtensionPrefs {
void MakePathsAbsolute(DictionaryValue* dict);
// Sets the pref |key| for extension |id| to |value|.
- bool UpdateExtensionPref(const std::string& id,
+ void UpdateExtensionPref(const std::string& id,
const std::wstring& key,
Value* value);
diff --git a/chrome/browser/extensions/extension_uitest.cc b/chrome/browser/extensions/extension_uitest.cc
index 2cfcd7c..42e2459 100644
--- a/chrome/browser/extensions/extension_uitest.cc
+++ b/chrome/browser/extensions/extension_uitest.cc
@@ -261,25 +261,19 @@ class RoundtripAutomationProxy : public MultiMessageAutomationProxy {
EXPECT_TRUE(has_callback);
DictionaryValue response_dict;
- EXPECT_TRUE(response_dict.SetInteger(keys::kAutomationRequestIdKey,
- request_id));
+ response_dict.SetInteger(keys::kAutomationRequestIdKey, request_id);
DictionaryValue tab_dict;
- EXPECT_TRUE(tab_dict.SetInteger(extension_tabs_module_constants::kIdKey,
- 42));
- EXPECT_TRUE(tab_dict.SetInteger(
- extension_tabs_module_constants::kIndexKey, 1));
- EXPECT_TRUE(tab_dict.SetInteger(
- extension_tabs_module_constants::kWindowIdKey, 1));
- EXPECT_TRUE(tab_dict.SetBoolean(
- extension_tabs_module_constants::kSelectedKey, true));
- EXPECT_TRUE(tab_dict.SetString(
- extension_tabs_module_constants::kUrlKey, "http://www.google.com"));
+ tab_dict.SetInteger(extension_tabs_module_constants::kIdKey, 42);
+ tab_dict.SetInteger(extension_tabs_module_constants::kIndexKey, 1);
+ tab_dict.SetInteger(extension_tabs_module_constants::kWindowIdKey, 1);
+ tab_dict.SetBoolean(extension_tabs_module_constants::kSelectedKey, true);
+ tab_dict.SetString(extension_tabs_module_constants::kUrlKey,
+ "http://www.google.com");
std::string tab_json;
base::JSONWriter::Write(&tab_dict, false, &tab_json);
- EXPECT_TRUE(response_dict.SetString(keys::kAutomationResponseKey,
- tab_json));
+ response_dict.SetString(keys::kAutomationResponseKey, tab_json);
std::string response_json;
base::JSONWriter::Write(&response_dict, false, &response_json);
diff --git a/chrome/browser/extensions/extensions_service_unittest.cc b/chrome/browser/extensions/extensions_service_unittest.cc
index 69e0c86..12b11cf 100644
--- a/chrome/browser/extensions/extensions_service_unittest.cc
+++ b/chrome/browser/extensions/extensions_service_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -389,7 +389,7 @@ class ExtensionsServiceTest
DictionaryValue* dict =
prefs_->GetMutableDictionary(L"extensions.settings");
ASSERT_TRUE(dict != NULL);
- EXPECT_EQ(count, dict->GetSize());
+ EXPECT_EQ(count, dict->size());
}
void ValidateBooleanPref(const std::string& extension_id,
diff --git a/chrome/browser/extensions/external_pref_extension_provider.cc b/chrome/browser/extensions/external_pref_extension_provider.cc
index e0f491f..841f156 100644
--- a/chrome/browser/extensions/external_pref_extension_provider.cc
+++ b/chrome/browser/extensions/external_pref_extension_provider.cc
@@ -44,10 +44,9 @@ void ExternalPrefExtensionProvider::VisitRegisteredExtension(
if (ids_to_ignore.find(WideToASCII(extension_id)) != ids_to_ignore.end())
continue;
- DictionaryValue* extension = NULL;
- if (!prefs_->GetDictionary(extension_id, &extension)) {
+ DictionaryValue* extension;
+ if (!prefs_->GetDictionaryWithoutPathExpansion(extension_id, &extension))
continue;
- }
FilePath::StringType external_crx;
std::string external_version;
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
index a32304e..46167ad 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
@@ -336,10 +336,10 @@ bool SandboxedExtensionUnpacker::RewriteImageFiles() {
bool SandboxedExtensionUnpacker::RewriteCatalogFiles(
const DictionaryValue& catalogs) {
// Write our parsed catalogs back to disk.
- DictionaryValue::key_iterator key_it = catalogs.begin_keys();
- for (; key_it != catalogs.end_keys(); ++key_it) {
+ for (DictionaryValue::key_iterator key_it = catalogs.begin_keys();
+ key_it != catalogs.end_keys(); ++key_it) {
DictionaryValue* catalog;
- if (!catalogs.GetDictionary(*key_it, &catalog)) {
+ if (!catalogs.GetDictionaryWithoutPathExpansion(*key_it, &catalog)) {
ReportFailure("Invalid catalog data.");
return false;
}
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index 922b004..fd889d5 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -571,7 +571,8 @@ void MetricsLog::WriteAllProfilesMetrics(
const std::wstring& key_name = *i;
if (key_name.compare(0, profile_prefix.size(), profile_prefix) == 0) {
DictionaryValue* profile;
- if (all_profiles_metrics.GetDictionary(key_name, &profile))
+ if (all_profiles_metrics.GetDictionaryWithoutPathExpansion(key_name,
+ &profile))
WriteProfileMetrics(key_name.substr(profile_prefix.size()), *profile);
}
}
@@ -584,7 +585,7 @@ void MetricsLog::WriteProfileMetrics(const std::wstring& profileidhash,
for (DictionaryValue::key_iterator i = profile_metrics.begin_keys();
i != profile_metrics.end_keys(); ++i) {
Value* value;
- if (profile_metrics.Get(*i, &value)) {
+ if (profile_metrics.GetWithoutPathExpansion(*i, &value)) {
DCHECK(*i != L"id");
switch (value->GetType()) {
case Value::TYPE_STRING: {
diff --git a/chrome/browser/sync/sync_setup_wizard_unittest.cc b/chrome/browser/sync/sync_setup_wizard_unittest.cc
index 4fa299f..b1ea56b 100644
--- a/chrome/browser/sync/sync_setup_wizard_unittest.cc
+++ b/chrome/browser/sync/sync_setup_wizard_unittest.cc
@@ -228,7 +228,7 @@ TEST_F(SyncSetupWizardTest, InitialStepLogin) {
EXPECT_EQ(SyncSetupWizard::GAIA_LOGIN, test_window_->flow()->current_state_);
dialog_args.Clear();
SyncSetupFlow::GetArgsForGaiaLogin(service_, &dialog_args);
- EXPECT_TRUE(3 == dialog_args.GetSize());
+ EXPECT_EQ(3U, dialog_args.size());
std::string actual_user;
dialog_args.GetString(L"user", &actual_user);
EXPECT_EQ(kTestUser, actual_user);
@@ -243,7 +243,7 @@ TEST_F(SyncSetupWizardTest, InitialStepLogin) {
service_->set_auth_state(kTestUser, captcha_error);
wizard_->Step(SyncSetupWizard::GAIA_LOGIN);
SyncSetupFlow::GetArgsForGaiaLogin(service_, &dialog_args);
- EXPECT_TRUE(3 == dialog_args.GetSize());
+ EXPECT_EQ(3U, dialog_args.size());
std::string captcha_url;
dialog_args.GetString(L"captchaUrl", &captcha_url);
EXPECT_EQ(kTestCaptchaUrl, GURL(captcha_url).spec());
@@ -394,7 +394,7 @@ TEST_F(SyncSetupWizardTest, DiscreteRun) {
wizard_->Step(SyncSetupWizard::GAIA_LOGIN);
EXPECT_TRUE(wizard_->IsVisible());
SyncSetupFlow::GetArgsForGaiaLogin(service_, &dialog_args);
- EXPECT_TRUE(3 == dialog_args.GetSize());
+ EXPECT_EQ(3U, dialog_args.size());
std::string actual_user;
dialog_args.GetString(L"user", &actual_user);
EXPECT_EQ(kTestUser, actual_user);
diff --git a/chrome/browser/thumbnail_store.cc b/chrome/browser/thumbnail_store.cc
index 9c16072..2a937dd 100644
--- a/chrome/browser/thumbnail_store.cc
+++ b/chrome/browser/thumbnail_store.cc
@@ -218,7 +218,7 @@ void ThumbnailStore::NotifyThumbnailStoreReady() {
void ThumbnailStore::UpdateURLData() {
DCHECK(url_blacklist_);
- int result_count = ThumbnailStore::kMaxCacheSize + url_blacklist_->GetSize();
+ int result_count = ThumbnailStore::kMaxCacheSize + url_blacklist_->size();
hs_->QueryTopURLsAndRedirects(result_count, &consumer_,
NewCallback(this, &ThumbnailStore::OnURLDataAvailable));
}
diff --git a/chrome/browser/webdata/web_database_unittest.cc b/chrome/browser/webdata/web_database_unittest.cc
index 4a54d76..beb716d 100644
--- a/chrome/browser/webdata/web_database_unittest.cc
+++ b/chrome/browser/webdata/web_database_unittest.cc
@@ -57,8 +57,8 @@ class WebDatabaseTest : public testing::Test {
DictionaryValue::key_iterator e(a.end_keys());
std::wstring av, bv;
while (i != e) {
- if (!(a.GetString(*i, &av)) ||
- !(b.GetString(*i, &bv)) ||
+ if (!(a.GetStringWithoutPathExpansion(*i, &av)) ||
+ !(b.GetStringWithoutPathExpansion(*i, &bv)) ||
av != bv)
return false;