| 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/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 203 } |
| 204 | 204 |
| 205 @end | 205 @end |
| 206 | 206 |
| 207 | 207 |
| 208 class FakeTheme : public ui::ThemeProvider { | 208 class FakeTheme : public ui::ThemeProvider { |
| 209 public: | 209 public: |
| 210 FakeTheme(NSColor* color) : color_(color) {} | 210 FakeTheme(NSColor* color) : color_(color) {} |
| 211 base::scoped_nsobject<NSColor> color_; | 211 base::scoped_nsobject<NSColor> color_; |
| 212 | 212 |
| 213 virtual bool UsingSystemTheme() const OVERRIDE { | 213 virtual bool UsingSystemTheme() const override { |
| 214 return true; | 214 return true; |
| 215 } | 215 } |
| 216 virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const OVERRIDE { | 216 virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const override { |
| 217 return NULL; | 217 return NULL; |
| 218 } | 218 } |
| 219 virtual SkColor GetColor(int id) const OVERRIDE { return SkColor(); } | 219 virtual SkColor GetColor(int id) const override { return SkColor(); } |
| 220 virtual int GetDisplayProperty(int id) const OVERRIDE { | 220 virtual int GetDisplayProperty(int id) const override { |
| 221 return -1; | 221 return -1; |
| 222 } | 222 } |
| 223 virtual bool ShouldUseNativeFrame() const OVERRIDE { return false; } | 223 virtual bool ShouldUseNativeFrame() const override { return false; } |
| 224 virtual bool HasCustomImage(int id) const OVERRIDE { return false; } | 224 virtual bool HasCustomImage(int id) const override { return false; } |
| 225 virtual base::RefCountedMemory* GetRawData( | 225 virtual base::RefCountedMemory* GetRawData( |
| 226 int id, | 226 int id, |
| 227 ui::ScaleFactor scale_factor) const OVERRIDE { | 227 ui::ScaleFactor scale_factor) const override { |
| 228 return NULL; | 228 return NULL; |
| 229 } | 229 } |
| 230 virtual NSImage* GetNSImageNamed(int id) const OVERRIDE { | 230 virtual NSImage* GetNSImageNamed(int id) const override { |
| 231 return nil; | 231 return nil; |
| 232 } | 232 } |
| 233 virtual NSColor* GetNSImageColorNamed(int id) const OVERRIDE { | 233 virtual NSColor* GetNSImageColorNamed(int id) const override { |
| 234 return nil; | 234 return nil; |
| 235 } | 235 } |
| 236 virtual NSColor* GetNSColor(int id) const OVERRIDE { | 236 virtual NSColor* GetNSColor(int id) const override { |
| 237 return color_.get(); | 237 return color_.get(); |
| 238 } | 238 } |
| 239 virtual NSColor* GetNSColorTint(int id) const OVERRIDE { | 239 virtual NSColor* GetNSColorTint(int id) const override { |
| 240 return nil; | 240 return nil; |
| 241 } | 241 } |
| 242 virtual NSGradient* GetNSGradient(int id) const OVERRIDE { | 242 virtual NSGradient* GetNSGradient(int id) const override { |
| 243 return nil; | 243 return nil; |
| 244 } | 244 } |
| 245 }; | 245 }; |
| 246 | 246 |
| 247 | 247 |
| 248 @interface FakeDragInfo : NSObject { | 248 @interface FakeDragInfo : NSObject { |
| 249 @public | 249 @public |
| 250 NSPoint dropLocation_; | 250 NSPoint dropLocation_; |
| 251 NSDragOperation sourceMask_; | 251 NSDragOperation sourceMask_; |
| 252 } | 252 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 // Make sure it's open so certain things aren't no-ops. | 335 // Make sure it's open so certain things aren't no-ops. |
| 336 [bar updateState:BookmarkBar::SHOW | 336 [bar updateState:BookmarkBar::SHOW |
| 337 changeType:BookmarkBar::DONT_ANIMATE_STATE_CHANGE]; | 337 changeType:BookmarkBar::DONT_ANIMATE_STATE_CHANGE]; |
| 338 } | 338 } |
| 339 }; | 339 }; |
| 340 | 340 |
| 341 class BookmarkBarControllerTest : public BookmarkBarControllerTestBase { | 341 class BookmarkBarControllerTest : public BookmarkBarControllerTestBase { |
| 342 public: | 342 public: |
| 343 base::scoped_nsobject<BookmarkBarControllerNoOpen> bar_; | 343 base::scoped_nsobject<BookmarkBarControllerNoOpen> bar_; |
| 344 | 344 |
| 345 virtual void SetUp() OVERRIDE { | 345 virtual void SetUp() override { |
| 346 BookmarkBarControllerTestBase::SetUp(); | 346 BookmarkBarControllerTestBase::SetUp(); |
| 347 ASSERT_TRUE(browser()); | 347 ASSERT_TRUE(browser()); |
| 348 AddCommandLineSwitches(); | 348 AddCommandLineSwitches(); |
| 349 | 349 |
| 350 bar_.reset( | 350 bar_.reset( |
| 351 [[BookmarkBarControllerNoOpen alloc] | 351 [[BookmarkBarControllerNoOpen alloc] |
| 352 initWithBrowser:browser() | 352 initWithBrowser:browser() |
| 353 initialWidth:NSWidth([parent_view_ frame]) | 353 initialWidth:NSWidth([parent_view_ frame]) |
| 354 delegate:nil | 354 delegate:nil |
| 355 resizeDelegate:resizeDelegate_.get()]); | 355 resizeDelegate:resizeDelegate_.get()]); |
| (...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2129 "2f3b ] 4b "); | 2129 "2f3b ] 4b "); |
| 2130 actual = test::ModelStringFromNode(root); | 2130 actual = test::ModelStringFromNode(root); |
| 2131 EXPECT_EQ(expected, actual); | 2131 EXPECT_EQ(expected, actual); |
| 2132 | 2132 |
| 2133 // Verify that the other bookmark folder can't be deleted. | 2133 // Verify that the other bookmark folder can't be deleted. |
| 2134 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; | 2134 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; |
| 2135 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); | 2135 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); |
| 2136 } | 2136 } |
| 2137 | 2137 |
| 2138 } // namespace | 2138 } // namespace |
| OLD | NEW |