| 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 "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #import "base/mac/mac_util.h" | 7 #import "base/mac/mac_util.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 view_list.push_back(VIEW_ID_FIND_BAR); | 288 view_list.push_back(VIEW_ID_FIND_BAR); |
| 289 view_list.push_back(VIEW_ID_TAB_CONTENT_AREA); | 289 view_list.push_back(VIEW_ID_TAB_CONTENT_AREA); |
| 290 view_list.push_back(VIEW_ID_DOWNLOAD_SHELF); | 290 view_list.push_back(VIEW_ID_DOWNLOAD_SHELF); |
| 291 VerifyZOrder(view_list); | 291 VerifyZOrder(view_list); |
| 292 } | 292 } |
| 293 | 293 |
| 294 // Presentation mode with Instant results showing. Should be exact same as | 294 // Presentation mode with Instant results showing. Should be exact same as |
| 295 // non-Instant presentation mode. | 295 // non-Instant presentation mode. |
| 296 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, | 296 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, |
| 297 ZOrderInstantPresentationMode) { | 297 ZOrderInstantPresentationMode) { |
| 298 // TODO(kbr): re-enable: http://crbug.com/222296 |
| 299 if (base::mac::IsOSMountainLionOrLater()) |
| 300 return; |
| 301 |
| 298 chrome::ToggleFullscreenMode(browser()); | 302 chrome::ToggleFullscreenMode(browser()); |
| 299 ShowInstantResults(); | 303 ShowInstantResults(); |
| 300 browser()->GetFindBarController(); // add find bar | 304 browser()->GetFindBarController(); // add find bar |
| 301 | 305 |
| 302 std::vector<ViewID> view_list; | 306 std::vector<ViewID> view_list; |
| 303 view_list.push_back(VIEW_ID_INFO_BAR); | 307 view_list.push_back(VIEW_ID_INFO_BAR); |
| 304 view_list.push_back(VIEW_ID_TAB_CONTENT_AREA); | 308 view_list.push_back(VIEW_ID_TAB_CONTENT_AREA); |
| 305 view_list.push_back(VIEW_ID_FULLSCREEN_FLOATING_BAR); | 309 view_list.push_back(VIEW_ID_FULLSCREEN_FLOATING_BAR); |
| 306 view_list.push_back(VIEW_ID_BOOKMARK_BAR); | 310 view_list.push_back(VIEW_ID_BOOKMARK_BAR); |
| 307 view_list.push_back(VIEW_ID_TOOLBAR); | 311 view_list.push_back(VIEW_ID_TOOLBAR); |
| 308 view_list.push_back(VIEW_ID_FIND_BAR); | 312 view_list.push_back(VIEW_ID_FIND_BAR); |
| 309 view_list.push_back(VIEW_ID_DOWNLOAD_SHELF); | 313 view_list.push_back(VIEW_ID_DOWNLOAD_SHELF); |
| 310 VerifyZOrder(view_list); | 314 VerifyZOrder(view_list); |
| 311 } | 315 } |
| 312 | 316 |
| 313 // Verify that if the fullscreen floating bar view is below the tab content area | 317 // Verify that if the fullscreen floating bar view is below the tab content area |
| 314 // then calling |updateSubviewZOrder:| will correctly move back above. | 318 // then calling |updateSubviewZOrder:| will correctly move back above. |
| 315 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, | 319 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, |
| 316 FloatingBarBelowContentView) { | 320 FloatingBarBelowContentView) { |
| 321 // TODO(kbr): re-enable: http://crbug.com/222296 |
| 322 if (base::mac::IsOSMountainLionOrLater()) |
| 323 return; |
| 324 |
| 317 chrome::ToggleFullscreenMode(browser()); | 325 chrome::ToggleFullscreenMode(browser()); |
| 318 | 326 |
| 319 NSView* fullscreen_floating_bar = | 327 NSView* fullscreen_floating_bar = |
| 320 GetViewWithID(VIEW_ID_FULLSCREEN_FLOATING_BAR); | 328 GetViewWithID(VIEW_ID_FULLSCREEN_FLOATING_BAR); |
| 321 [fullscreen_floating_bar removeFromSuperview]; | 329 [fullscreen_floating_bar removeFromSuperview]; |
| 322 [[[controller() window] contentView] addSubview:fullscreen_floating_bar | 330 [[[controller() window] contentView] addSubview:fullscreen_floating_bar |
| 323 positioned:NSWindowBelow | 331 positioned:NSWindowBelow |
| 324 relativeTo:nil]; | 332 relativeTo:nil]; |
| 325 [controller() updateSubviewZOrder:[controller() inPresentationMode]]; | 333 [controller() updateSubviewZOrder:[controller() inPresentationMode]]; |
| 326 | 334 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 356 | 364 |
| 357 // Minus bookmark bar. | 365 // Minus bookmark bar. |
| 358 browser()->window()->ToggleBookmarkBar(); | 366 browser()->window()->ToggleBookmarkBar(); |
| 359 EXPECT_EQ(GetViewHeight(VIEW_ID_INFO_BAR), [overlay activeContainerOffset]); | 367 EXPECT_EQ(GetViewHeight(VIEW_ID_INFO_BAR), [overlay activeContainerOffset]); |
| 360 } | 368 } |
| 361 | 369 |
| 362 // Verify that in non-Instant presentation mode the content area is beneath | 370 // Verify that in non-Instant presentation mode the content area is beneath |
| 363 // the info bar. | 371 // the info bar. |
| 364 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, | 372 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, |
| 365 ContentOffsetPresentationMode) { | 373 ContentOffsetPresentationMode) { |
| 374 // TODO(kbr): re-enable: http://crbug.com/222296 |
| 375 if (base::mac::IsOSMountainLionOrLater()) |
| 376 return; |
| 377 |
| 366 chrome::ToggleFullscreenMode(browser()); | 378 chrome::ToggleFullscreenMode(browser()); |
| 367 OverlayableContentsController* overlay = | 379 OverlayableContentsController* overlay = |
| 368 [controller() overlayableContentsController]; | 380 [controller() overlayableContentsController]; |
| 369 | 381 |
| 370 // Just toolbar. | 382 // Just toolbar. |
| 371 EXPECT_EQ(0, [overlay activeContainerOffset]); | 383 EXPECT_EQ(0, [overlay activeContainerOffset]); |
| 372 | 384 |
| 373 // Plus bookmark bar. | 385 // Plus bookmark bar. |
| 374 browser()->window()->ToggleBookmarkBar(); | 386 browser()->window()->ToggleBookmarkBar(); |
| 375 EXPECT_EQ(0, [overlay activeContainerOffset]); | 387 EXPECT_EQ(0, [overlay activeContainerOffset]); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 | 453 |
| 442 NSView* bookmarkView = [[controller() bookmarkBarController] view]; | 454 NSView* bookmarkView = [[controller() bookmarkBarController] view]; |
| 443 NSView* contentView = [[controller() window] contentView]; | 455 NSView* contentView = [[controller() window] contentView]; |
| 444 NSPoint point = [bookmarkView convertPoint:NSMakePoint(1, 1) | 456 NSPoint point = [bookmarkView convertPoint:NSMakePoint(1, 1) |
| 445 toView:[contentView superview]]; | 457 toView:[contentView superview]]; |
| 446 | 458 |
| 447 EXPECT_FALSE([[contentView hitTest:point] isDescendantOf:bookmarkView]); | 459 EXPECT_FALSE([[contentView hitTest:point] isDescendantOf:bookmarkView]); |
| 448 EXPECT_TRUE([[contentView hitTest:point] | 460 EXPECT_TRUE([[contentView hitTest:point] |
| 449 isDescendantOf:[controller() tabContentArea]]); | 461 isDescendantOf:[controller() tabContentArea]]); |
| 450 } | 462 } |
| OLD | NEW |