| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <cmath> | 5 #include <cmath> |
| 6 | 6 |
| 7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" | 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 GURL("http://www.google.com/c")); | 172 GURL("http://www.google.com/c")); |
| 173 | 173 |
| 174 bar_.reset([[BookmarkBarControllerChildFolderRedirect alloc] | 174 bar_.reset([[BookmarkBarControllerChildFolderRedirect alloc] |
| 175 initWithBrowser:browser() | 175 initWithBrowser:browser() |
| 176 initialWidth:300 | 176 initialWidth:300 |
| 177 delegate:nil]); | 177 delegate:nil]); |
| 178 [bar_ loaded:model]; | 178 [bar_ loaded:model]; |
| 179 // Make parent frame for bookmark bar then open it. | 179 // Make parent frame for bookmark bar then open it. |
| 180 NSRect frame = [[test_window() contentView] frame]; | 180 NSRect frame = [[test_window() contentView] frame]; |
| 181 frame = NSMakeRect(frame.origin.x, | 181 frame = NSMakeRect(frame.origin.x, |
| 182 frame.size.height - chrome::kNTPBookmarkBarHeight, | 182 frame.size.height - chrome::kNTPMinimumBookmarkBarHeight, |
| 183 frame.size.width, chrome::kNTPBookmarkBarHeight); | 183 frame.size.width, chrome::kNTPMinimumBookmarkBarHeight); |
| 184 NSView* fakeToolbarView = [[[NSView alloc] initWithFrame:frame] | 184 NSView* fakeToolbarView = [[[NSView alloc] initWithFrame:frame] |
| 185 autorelease]; | 185 autorelease]; |
| 186 [[test_window() contentView] addSubview:fakeToolbarView]; | 186 [[test_window() contentView] addSubview:fakeToolbarView]; |
| 187 [fakeToolbarView addSubview:[bar_ view]]; | 187 [fakeToolbarView addSubview:[bar_ view]]; |
| 188 [bar_ setBookmarkBarEnabled:YES]; | 188 [bar_ setBookmarkBarEnabled:YES]; |
| 189 } | 189 } |
| 190 | 190 |
| 191 // Remove the bookmark with the long title. | 191 // Remove the bookmark with the long title. |
| 192 void RemoveLongTitleNode() { | 192 void RemoveLongTitleNode() { |
| 193 BookmarkModel* model = | 193 BookmarkModel* model = |
| (...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1669 DeleteBookmark([folder parentButton], profile()); | 1669 DeleteBookmark([folder parentButton], profile()); |
| 1670 EXPECT_FALSE([folder folderController]); | 1670 EXPECT_FALSE([folder folderController]); |
| 1671 } | 1671 } |
| 1672 | 1672 |
| 1673 // TODO(jrg): draggingEntered: and draggingExited: trigger timers so | 1673 // TODO(jrg): draggingEntered: and draggingExited: trigger timers so |
| 1674 // they are hard to test. Factor out "fire timers" into routines | 1674 // they are hard to test. Factor out "fire timers" into routines |
| 1675 // which can be overridden to fire immediately to make behavior | 1675 // which can be overridden to fire immediately to make behavior |
| 1676 // confirmable. | 1676 // confirmable. |
| 1677 // There is a similar problem with mouseEnteredButton: and | 1677 // There is a similar problem with mouseEnteredButton: and |
| 1678 // mouseExitedButton:. | 1678 // mouseExitedButton:. |
| OLD | NEW |