summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-29 16:11:49 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-29 16:11:49 +0000
commitd3dedf792aa86c5d8b174f3d424b9f02ce1c8782 (patch)
treeab1f42e1377b157c8860eafc61352d04860406f0
parentc1541a5a10492197c9966f734ea5c505184535a5 (diff)
downloadchromium_src-d3dedf792aa86c5d8b174f3d424b9f02ce1c8782.zip
chromium_src-d3dedf792aa86c5d8b174f3d424b9f02ce1c8782.tar.gz
chromium_src-d3dedf792aa86c5d8b174f3d424b9f02ce1c8782.tar.bz2
Do not check against child_count() > 0, instead check if node is not empty().
Use TreeNode::empty() accessor function for checking if node has children or if it isn't empty, instead of using child_count(). BUG=None TEST=None R=gbillock@chromium.org Review URL: http://codereview.chromium.org/7775001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98639 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/intents/intents_model.cc2
-rw-r--r--chrome/browser/ui/webui/options/intents_settings_handler.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/chrome/browser/ui/intents/intents_model.cc b/chrome/browser/ui/intents/intents_model.cc
index 919dbe3..4aa0911 100644
--- a/chrome/browser/ui/intents/intents_model.cc
+++ b/chrome/browser/ui/intents/intents_model.cc
@@ -95,7 +95,7 @@ void IntentsModel::GetIntentsTreeNodeDictionary(const IntentsTreeNode& node,
if (node.Type() == IntentsTreeNode::TYPE_ORIGIN) {
dict->SetString("site", node.GetTitle());
- dict->SetBoolean("hasChildren", node.child_count() > 0);
+ dict->SetBoolean("hasChildren", !node.empty());
return;
}
diff --git a/chrome/browser/ui/webui/options/intents_settings_handler.cc b/chrome/browser/ui/webui/options/intents_settings_handler.cc
index 42f4868..2656e72 100644
--- a/chrome/browser/ui/webui/options/intents_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/intents_settings_handler.cc
@@ -103,7 +103,7 @@ void IntentsSettingsHandler::RemoveIntent(const base::ListValue* args) {
void IntentsSettingsHandler::RemoveOrigin(IntentsTreeNode* node) {
// TODO(gbillock): This is a known batch update. Worth optimizing?
- while (node->child_count() > 0) {
+ while (!node->empty()) {
IntentsTreeNode* cnode = node->GetChild(0);
CHECK(cnode->Type() == IntentsTreeNode::TYPE_SERVICE);
ServiceTreeNode* snode = static_cast<ServiceTreeNode*>(cnode);