| Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm
|
| 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 ff6ba4b43f9382b4fc790246c3eea4528e3776e8..9743fcc952381c9a0dd046948e3819d56bde72e0 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
|
| @@ -36,7 +36,7 @@ const int kLotsOfNodesCount = 150;
|
| void DeleteBookmark(BookmarkButton* button, Profile* profile) {
|
| const BookmarkNode* node = [button bookmarkNode];
|
| if (node) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile);
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile);
|
| model->Remove(node);
|
| }
|
| }
|
| @@ -147,7 +147,8 @@ class BookmarkBarFolderControllerTest : public CocoaProfileTest {
|
| }
|
|
|
| void CreateModel() {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model =
|
| + BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* parent = model->bookmark_bar_node();
|
| const BookmarkNode* folderA = model->AddFolder(parent,
|
| parent->child_count(),
|
| @@ -189,14 +190,16 @@ class BookmarkBarFolderControllerTest : public CocoaProfileTest {
|
|
|
| // Remove the bookmark with the long title.
|
| void RemoveLongTitleNode() {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model =
|
| + BookmarkModelFactory::GetForBrowserContext(profile());
|
| model->Remove(longTitleNode_);
|
| }
|
|
|
| // Add LOTS of nodes to our model if needed (e.g. scrolling).
|
| // Returns the number of nodes added.
|
| int AddLotsOfNodes() {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model =
|
| + BookmarkModelFactory::GetForBrowserContext(profile());
|
| for (int i = 0; i < kLotsOfNodesCount; i++) {
|
| model->AddURL(folderA_, folderA_->child_count(),
|
| ASCIIToUTF16("repeated title"),
|
| @@ -298,7 +301,7 @@ TEST_F(BookmarkBarFolderControllerTest, BasicPosition) {
|
| // Confirm we grow right until end of screen, then start growing left
|
| // until end of screen again, then right.
|
| TEST_F(BookmarkBarFolderControllerTest, PositionRightLeftRight) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* parent = model->bookmark_bar_node();
|
| const BookmarkNode* folder = parent;
|
|
|
| @@ -747,7 +750,7 @@ class BookmarkBarFolderControllerMenuTest : public CocoaProfileTest {
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, DragMoveBarBookmarkToFolder) {
|
| WithNoAnimation at_all;
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2f:[ 2f1b 2f2f:[ 2f2f1b 2f2f2b "
|
| "2f2f3b ] 2f3b ] 3b 4f:[ 4f1f:[ 4f1f1b 4f1f2b 4f1f3b ] 4f2f:[ 4f2f1b "
|
| @@ -820,7 +823,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, DragMoveBarBookmarkToFolder) {
|
| }
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, DragCopyBarBookmarkToFolder) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2f:[ 2f1b 2f2f:[ 2f2f1b 2f2f2b "
|
| "2f2f3b ] 2f3b ] 3b 4f:[ 4f1f:[ 4f1f1b 4f1f2b 4f1f3b ] 4f2f:[ 4f2f1b "
|
| @@ -884,7 +887,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, DragCopyBarBookmarkToFolder) {
|
| }
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, DragMoveBarBookmarkToSubfolder) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2f:[ 2f1b 2f2f:[ 2f2f1b 2f2f2b "
|
| "2f2f3b ] 2f3b ] 3b 4f:[ 4f1f:[ 4f1f1b 4f1f2b 4f1f3b ] 4f2f:[ 4f2f1b "
|
| @@ -949,7 +952,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, DragMoveBarBookmarkToSubfolder) {
|
| }
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, DragMoveWithinFolder) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2f:[ 2f1b 2f2f:[ 2f2f1b 2f2f2b "
|
| "2f2f3b ] 2f3b ] 3b 4f:[ 4f1f:[ 4f1f1b 4f1f2b 4f1f3b ] 4f2f:[ 4f2f1b "
|
| @@ -998,7 +1001,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, DragMoveWithinFolder) {
|
| }
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, DragParentOntoChild) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2f:[ 2f1b 2f2f:[ 2f2f1b 2f2f2b "
|
| "2f2f3b ] 2f3b ] 3b 4f:[ 4f1f:[ 4f1f1b 4f1f2b 4f1f3b ] 4f2f:[ 4f2f1b "
|
| @@ -1035,7 +1038,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, DragParentOntoChild) {
|
| }
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, DragMoveChildToParent) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2f:[ 2f1b 2f2f:[ 2f2f1b 2f2f2b "
|
| "2f2f3b ] 2f3b ] 3b 4f:[ 4f1f:[ 4f1f1b 4f1f2b 4f1f3b ] 4f2f:[ 4f2f1b "
|
| @@ -1087,7 +1090,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, DragMoveChildToParent) {
|
| }
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, DragWindowResizing) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string(
|
| "a b:[ b1 b2 b3 ] reallyReallyLongBookmarkName c ");
|
| @@ -1127,7 +1130,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, DragWindowResizing) {
|
| }
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, MoveRemoveAddButtons) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2f:[ 2f1b 2f2b 2f3b ] 3b 4b ");
|
| bookmarks::test::AddNodesFromModelString(model, root, model_string);
|
| @@ -1190,7 +1193,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, MoveRemoveAddButtons) {
|
| }
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, RemoveLastButtonOtherBookmarks) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* otherBookmarks = model->other_node();
|
|
|
| BookmarkButton* otherButton = [bar_ otherBookmarksButton];
|
| @@ -1227,7 +1230,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, RemoveLastButtonOtherBookmarks) {
|
| }
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, ControllerForNode) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2f:[ 2f1b 2f2b ] 3b ");
|
| bookmarks::test::AddNodesFromModelString(model, root, model_string);
|
| @@ -1262,7 +1265,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, ControllerForNode) {
|
| }
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, MenuSizingAndScrollArrows) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2b 3b ");
|
| bookmarks::test::AddNodesFromModelString(model, root, model_string);
|
| @@ -1359,7 +1362,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, MenuSizingAndScrollArrows) {
|
|
|
| // See http://crbug.com/46101
|
| TEST_F(BookmarkBarFolderControllerMenuTest, HoverThenDeleteBookmark) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const BookmarkNode* folder = model->AddFolder(root,
|
| root->child_count(),
|
| @@ -1427,7 +1430,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, HoverThenDeleteBookmark) {
|
| @end
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, DragBookmarkData) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2f:[ 2f1b 2f2f:[ 2f2f1b 2f2f2b 2f2f3b ] "
|
| "2f3b ] 3b 4b ");
|
| @@ -1489,7 +1492,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, DragBookmarkData) {
|
| }
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, DragBookmarkDataToTrash) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2f:[ 2f1b 2f2f:[ 2f2f1b 2f2f2b 2f2f3b ] "
|
| "2f3b ] 3b 4b ");
|
| @@ -1532,7 +1535,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, DragBookmarkDataToTrash) {
|
| }
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, AddURLs) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2f:[ 2f1b 2f2f:[ 2f2f1b 2f2f2b 2f2f3b ] "
|
| "2f3b ] 3b 4b ");
|
| @@ -1577,7 +1580,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, AddURLs) {
|
| }
|
|
|
| TEST_F(BookmarkBarFolderControllerMenuTest, DropPositionIndicator) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2f:[ 2f1b 2f2f:[ 2f2f1b 2f2f2b 2f2f3b ] "
|
| "2f3b ] 3b 4b ");
|
| @@ -1637,7 +1640,7 @@ class BookmarkBarFolderControllerClosingTest : public
|
| };
|
|
|
| TEST_F(BookmarkBarFolderControllerClosingTest, DeleteClosesFolder) {
|
| - BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
|
| + BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
|
| const BookmarkNode* root = model->bookmark_bar_node();
|
| const std::string model_string("1b 2f:[ 2f1b 2f2f:[ 2f2f1b 2f2f2b ] "
|
| "2f3b ] 3b ");
|
|
|