summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/bookmarks
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-08 23:27:29 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-08 23:27:29 +0000
commit2d48ee84a9106c6c940f2eca90b1df2f4f9e8b6f (patch)
treec03683aaf8823ef3749c9dbc5795d2ec04ba7d9a /chrome/browser/ui/cocoa/bookmarks
parent7b405112c0556e36644b1cd8aa6f253952b4b89e (diff)
downloadchromium_src-2d48ee84a9106c6c940f2eca90b1df2f4f9e8b6f.zip
chromium_src-2d48ee84a9106c6c940f2eca90b1df2f4f9e8b6f.tar.gz
chromium_src-2d48ee84a9106c6c940f2eca90b1df2f4f9e8b6f.tar.bz2
Rename TreeNode::GetParent() to TreeNode::parent(). Part 2
This is part of a serie of patches to make the TreeNode API more closer to style used in the Views Tree API (see views/view.h for reference). BUG=None TEST=None Review URL: http://codereview.chromium.org/6626076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/cocoa/bookmarks')
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm16
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm2
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm6
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm4
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm8
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm4
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm2
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm2
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller_unittest.mm12
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa_unittest.mm2
11 files changed, 30 insertions, 30 deletions
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index e63b645..bfa141a 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -288,7 +288,7 @@ void RecordAppLaunch(Profile* profile, GURL url) {
[otherBookmarksButton_ setIsContinuousPulsing:doPulse];
return;
}
- if (node->GetParent() == bookmarkModel_->GetBookmarkBarNode()) {
+ if (node->parent() == bookmarkModel_->GetBookmarkBarNode()) {
[offTheSideButton_ setIsContinuousPulsing:doPulse];
return;
}
@@ -612,7 +612,7 @@ void RecordAppLaunch(Profile* profile, GURL url) {
// UI.
BookmarkEditor::Show([[self view] window],
browser_->profile(),
- node->GetParent(),
+ node->parent(),
BookmarkEditor::EditDetails(node),
BookmarkEditor::SHOW_TREE);
}
@@ -643,7 +643,7 @@ void RecordAppLaunch(Profile* profile, GURL url) {
if (node) {
int index = -1;
if (node != bookmarkModel_->GetBookmarkBarNode() && !node->is_folder()) {
- const BookmarkNode* parent = node->GetParent();
+ const BookmarkNode* parent = node->parent();
index = parent->GetIndexOf(node) + 1;
if (index > parent->GetChildCount())
index = -1;
@@ -656,8 +656,8 @@ void RecordAppLaunch(Profile* profile, GURL url) {
- (IBAction)deleteBookmark:(id)sender {
const BookmarkNode* node = [self nodeFromMenuItem:sender];
if (node) {
- bookmarkModel_->Remove(node->GetParent(),
- node->GetParent()->GetIndexOf(node));
+ bookmarkModel_->Remove(node->parent(),
+ node->parent()->GetIndexOf(node));
}
}
@@ -719,7 +719,7 @@ void RecordAppLaunch(Profile* profile, GURL url) {
parent = senderNode;
newIndex = parent->GetChildCount();
} else {
- parent = senderNode->GetParent();
+ parent = senderNode->parent();
newIndex = parent->GetIndexOf(senderNode) + 1;
}
BookmarkNameFolderController* controller =
@@ -1758,7 +1758,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
const BookmarkNode* afterNode =
[buttonToTheRightOfDraggedButton bookmarkNode];
DCHECK(afterNode);
- int index = afterNode->GetParent()->GetIndexOf(afterNode);
+ int index = afterNode->parent()->GetIndexOf(afterNode);
// Make sure we don't get confused by buttons which aren't visible.
return std::min(index, displayedButtonCount_);
}
@@ -2063,7 +2063,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
// http://crbug.com/35966
const BookmarkNode* node = [button bookmarkNode];
if (node) {
- const BookmarkNode* parent = node->GetParent();
+ const BookmarkNode* parent = node->parent();
bookmarkModel_->Remove(parent,
parent->GetIndexOf(node));
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
index 0b187ab..7ff8540 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
@@ -1563,7 +1563,7 @@ TEST_F(BookmarkBarControllerTest, NodeDeletedWhileContextMenuIsOpen) {
[bar_ setButtonContextMenu:fakeMenu];
// Force a delete which should cancelTracking on the menu.
- model->Remove(framma->GetParent(), framma->GetParent()->GetIndexOf(framma));
+ model->Remove(framma->parent(), framma->parent()->GetIndexOf(framma));
// Restore, then confirm cancelTracking was called.
[bar_ setButtonContextMenu:origMenu];
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm
index e91db0f..76b7dca 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm
@@ -1156,7 +1156,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
bookmarkNode];
DCHECK(beforeNode);
// Be careful if the number of buttons != number of nodes.
- return ((beforeNode->GetParent()->GetIndexOf(beforeNode) + 1) -
+ return ((beforeNode->parent()->GetIndexOf(beforeNode) + 1) -
[[parentButton_ cell] startingChildIndex]);
}
@@ -1277,7 +1277,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
// http://crbug.com/35966
const BookmarkNode* node = [button bookmarkNode];
if (node) {
- const BookmarkNode* parent = node->GetParent();
+ const BookmarkNode* parent = node->parent();
[self bookmarkModel]->Remove(parent,
parent->GetIndexOf(node));
}
@@ -1477,7 +1477,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
// When adding a button to an empty folder we must remove the 'empty'
// placeholder button. This can be detected by checking for a parent
// child count of 1.
- const BookmarkNode* parentNode = node->GetParent();
+ const BookmarkNode* parentNode = node->parent();
if (parentNode->GetChildCount() == 1) {
BookmarkButton* emptyButton = [buttons_ lastObject];
newButtonFrame = [emptyButton frame];
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm
index 85ac568..ee9686d 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm
@@ -174,8 +174,8 @@ class BookmarkBarFolderControllerTest : public CocoaTest {
// Remove the bookmark with the long title.
void RemoveLongTitleNode() {
BookmarkModel* model = helper_.profile()->GetBookmarkModel();
- model->Remove(longTitleNode_->GetParent(),
- longTitleNode_->GetParent()->GetIndexOf(longTitleNode_));
+ model->Remove(longTitleNode_->parent(),
+ longTitleNode_->parent()->GetIndexOf(longTitleNode_));
}
// Add LOTS of nodes to our model if needed (e.g. scrolling).
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
index d0a6dd8..5d32a8d 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
@@ -116,7 +116,7 @@ void BookmarkBubbleNotificationBridge::Observe(
// until we find something visible to pulse.
- (void)startPulsingBookmarkButton:(const BookmarkNode*)node {
while (node) {
- if ((node->GetParent() == model_->GetBookmarkBarNode()) ||
+ if ((node->parent() == model_->GetBookmarkBarNode()) ||
(node == model_->other_node())) {
pulsingBookmarkNode_ = node;
NSValue *value = [NSValue valueWithPointer:node];
@@ -132,7 +132,7 @@ void BookmarkBubbleNotificationBridge::Observe(
userInfo:dict];
return;
}
- node = node->GetParent();
+ node = node->parent();
}
}
@@ -332,7 +332,7 @@ void BookmarkBubbleNotificationBridge::Observe(
model_->profile());
}
// Then the parent folder.
- const BookmarkNode* oldParent = node_->GetParent();
+ const BookmarkNode* oldParent = node_->parent();
NSMenuItem* selectedItem = [folderPopUpButton_ selectedItem];
id representedObject = [selectedItem representedObject];
if ([representedObject isEqual:[[self class] chooseAnotherFolderObject]]) {
@@ -365,7 +365,7 @@ void BookmarkBubbleNotificationBridge::Observe(
ChooseAnotherFolder* obj = [[self class] chooseAnotherFolderObject];
[item setRepresentedObject:obj];
// Finally, select the current parent.
- NSValue* parentValue = [NSValue valueWithPointer:node_->GetParent()];
+ NSValue* parentValue = [NSValue valueWithPointer:node_->parent()];
NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue];
[folderPopUpButton_ selectItemAtIndex:idx];
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm
index ef3a47a..709ce70 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm
@@ -277,7 +277,7 @@ TEST_F(BookmarkBubbleControllerTest, TestUserEdit) {
// Make sure bookmark has changed
EXPECT_EQ(node->GetTitle(), ASCIIToUTF16("oops"));
- EXPECT_EQ(node->GetParent()->GetTitle(), ASCIIToUTF16("grandma"));
+ EXPECT_EQ(node->parent()->GetTitle(), ASCIIToUTF16("grandma"));
}
// Confirm happiness with parent nodes that have the same name.
@@ -308,7 +308,7 @@ TEST_F(BookmarkBubbleControllerTest, TestNewParentSameName) {
// Make sure bookmark has changed, and that the parent is what we
// expect. This proves nobody did searching based on name.
- EXPECT_EQ(node->GetParent(), bookmarkBarNode->GetChild(i));
+ EXPECT_EQ(node->parent(), bookmarkBarNode->GetChild(i));
}
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm
index 191f371..e9f0575 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm
@@ -180,7 +180,7 @@ BookmarkButton* gDraggedButton = nil; // Weak
delay:NO];
}
const BookmarkNode* node = [self bookmarkNode];
- const BookmarkNode* parent = node ? node->GetParent() : NULL;
+ const BookmarkNode* parent = node ? node->parent() : NULL;
if (parent && parent->type() == BookmarkNode::FOLDER) {
UserMetrics::RecordAction(UserMetricsAction("BookmarkBarFolder_DragStart"));
} else {
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
index 129117d..294c0f9 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
@@ -145,7 +145,7 @@
const BookmarkNode* node =
static_cast<const BookmarkNode*>([[self representedObject] pointerValue]);
- if (node->GetParent() && node->GetParent()->type() == BookmarkNode::FOLDER) {
+ if (node->parent() && node->parent()->type() == BookmarkNode::FOLDER) {
UserMetrics::RecordAction(UserMetricsAction("BookmarkBarFolder_CtxMenu"));
} else {
UserMetrics::RecordAction(UserMetricsAction("BookmarkBar_CtxMenu"));
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm
index 329a027..8d4f312 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm
@@ -364,7 +364,7 @@ class BookmarkEditorBaseControllerBridge : public BookmarkModelObserver {
while (node != rootNode) {
DCHECK(node);
nodeStack.push(node);
- node = node->GetParent();
+ node = node->parent();
}
NSUInteger stackSize = nodeStack.size();
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller_unittest.mm
index 2fbd889..5e27422 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller_unittest.mm
@@ -348,22 +348,22 @@ TEST_F(BookmarkEditorControllerTreeTest, VerifyBookmarkTestModel) {
}
TEST_F(BookmarkEditorControllerTreeTest, RenameBookmarkInPlace) {
- const BookmarkNode* oldParent = bookmark_bb_3_->GetParent();
+ const BookmarkNode* oldParent = bookmark_bb_3_->parent();
[controller_ setDisplayName:@"NEW NAME"];
[controller_ ok:nil];
UpdateBB3();
- const BookmarkNode* newParent = bookmark_bb_3_->GetParent();
+ const BookmarkNode* newParent = bookmark_bb_3_->parent();
ASSERT_EQ(newParent, oldParent);
int childIndex = newParent->GetIndexOf(bookmark_bb_3_);
ASSERT_EQ(3, childIndex);
}
TEST_F(BookmarkEditorControllerTreeTest, ChangeBookmarkURLInPlace) {
- const BookmarkNode* oldParent = bookmark_bb_3_->GetParent();
+ const BookmarkNode* oldParent = bookmark_bb_3_->parent();
[controller_ setDisplayURL:@"https://bb-3.com"];
[controller_ ok:nil];
UpdateBB3();
- const BookmarkNode* newParent = bookmark_bb_3_->GetParent();
+ const BookmarkNode* newParent = bookmark_bb_3_->parent();
ASSERT_EQ(newParent, oldParent);
int childIndex = newParent->GetIndexOf(bookmark_bb_3_);
ASSERT_EQ(3, childIndex);
@@ -373,7 +373,7 @@ TEST_F(BookmarkEditorControllerTreeTest, ChangeBookmarkGroup) {
[controller_ selectTestNodeInBrowser:group_c_];
[controller_ ok:nil];
UpdateBB3();
- const BookmarkNode* parent = bookmark_bb_3_->GetParent();
+ const BookmarkNode* parent = bookmark_bb_3_->parent();
ASSERT_EQ(parent, group_c_);
int childIndex = parent->GetIndexOf(bookmark_bb_3_);
ASSERT_EQ(4, childIndex);
@@ -384,7 +384,7 @@ TEST_F(BookmarkEditorControllerTreeTest, ChangeNameAndBookmarkGroup) {
[controller_ selectTestNodeInBrowser:group_c_];
[controller_ ok:nil];
UpdateBB3();
- const BookmarkNode* parent = bookmark_bb_3_->GetParent();
+ const BookmarkNode* parent = bookmark_bb_3_->parent();
ASSERT_EQ(parent, group_c_);
int childIndex = parent->GetIndexOf(bookmark_bb_3_);
ASSERT_EQ(4, childIndex);
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa_unittest.mm
index 5ff8687..b01769b 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa_unittest.mm
@@ -61,7 +61,7 @@ TEST_F(BookmarkModelObserverForCocoaTest, TestCallback) {
model->Move(node, model->other_node(), 0);
EXPECT_EQ(3, pingCount.get()->pings);
- model->Remove(node->GetParent(), 0);
+ model->Remove(node->parent(), 0);
EXPECT_EQ(4, pingCount.get()->pings);
}