| 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/scoped_nsobject.h" | 9 #include "base/memory/scoped_nsobject.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/sys_string_conversions.h" | 12 #include "base/sys_string_conversions.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/browser/bookmarks/bookmark_model.h" | 14 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 15 #include "chrome/browser/bookmarks/bookmark_utils.h" | 15 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 16 #include "chrome/browser/extensions/extension_system_factory.h" | |
| 17 #include "chrome/browser/extensions/test_extension_system.h" | 16 #include "chrome/browser/extensions/test_extension_system.h" |
| 18 #import "chrome/browser/ui/cocoa/animation_utils.h" | 17 #import "chrome/browser/ui/cocoa/animation_utils.h" |
| 19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" | 18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" |
| 20 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
| 21 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.h" | 20 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.h" |
| 22 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_unittest_helper.h" | 21 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_unittest_helper.h" |
| 23 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.h" | 22 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.h" |
| 24 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" | 23 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" |
| 25 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" | 24 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" |
| 26 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu.h" | 25 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 public: | 267 public: |
| 269 scoped_nsobject<NSView> parent_view_; | 268 scoped_nsobject<NSView> parent_view_; |
| 270 scoped_nsobject<ViewResizerPong> resizeDelegate_; | 269 scoped_nsobject<ViewResizerPong> resizeDelegate_; |
| 271 | 270 |
| 272 virtual void SetUp() { | 271 virtual void SetUp() { |
| 273 CocoaProfileTest::SetUp(); | 272 CocoaProfileTest::SetUp(); |
| 274 ASSERT_TRUE(profile()); | 273 ASSERT_TRUE(profile()); |
| 275 | 274 |
| 276 FilePath extension_dir; | 275 FilePath extension_dir; |
| 277 static_cast<TestExtensionSystem*>( | 276 static_cast<TestExtensionSystem*>( |
| 278 ExtensionSystemFactory::GetForProfile(profile()))-> | 277 ExtensionSystem::Get(profile()))-> |
| 279 CreateExtensionService( | 278 CreateExtensionService( |
| 280 CommandLine::ForCurrentProcess(), | 279 CommandLine::ForCurrentProcess(), |
| 281 extension_dir, false); | 280 extension_dir, false); |
| 282 resizeDelegate_.reset([[ViewResizerPong alloc] init]); | 281 resizeDelegate_.reset([[ViewResizerPong alloc] init]); |
| 283 NSRect parent_frame = NSMakeRect(0, 0, 800, 50); | 282 NSRect parent_frame = NSMakeRect(0, 0, 800, 50); |
| 284 parent_view_.reset([[NSView alloc] initWithFrame:parent_frame]); | 283 parent_view_.reset([[NSView alloc] initWithFrame:parent_frame]); |
| 285 [parent_view_ setHidden:YES]; | 284 [parent_view_ setHidden:YES]; |
| 286 } | 285 } |
| 287 | 286 |
| 288 void InstallAndToggleBar(BookmarkBarController* bar) { | 287 void InstallAndToggleBar(BookmarkBarController* bar) { |
| (...skipping 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2186 "2f3b ] 4b "); | 2185 "2f3b ] 4b "); |
| 2187 actual = model_test_utils::ModelStringFromNode(root); | 2186 actual = model_test_utils::ModelStringFromNode(root); |
| 2188 EXPECT_EQ(expected, actual); | 2187 EXPECT_EQ(expected, actual); |
| 2189 | 2188 |
| 2190 // Verify that the other bookmark folder can't be deleted. | 2189 // Verify that the other bookmark folder can't be deleted. |
| 2191 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; | 2190 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; |
| 2192 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); | 2191 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); |
| 2193 } | 2192 } |
| 2194 | 2193 |
| 2195 } // namespace | 2194 } // namespace |
| OLD | NEW |