| 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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 CGFloat GetViewHeight(ViewID viewID) const { | 135 CGFloat GetViewHeight(ViewID viewID) const { |
| 136 CGFloat height = NSHeight([GetViewWithID(viewID) frame]); | 136 CGFloat height = NSHeight([GetViewWithID(viewID) frame]); |
| 137 if (viewID == VIEW_ID_INFO_BAR) { | 137 if (viewID == VIEW_ID_INFO_BAR) { |
| 138 height -= [[controller() infoBarContainerController] | 138 height -= [[controller() infoBarContainerController] |
| 139 overlappingTipHeight]; | 139 overlappingTipHeight]; |
| 140 } | 140 } |
| 141 return height; | 141 return height; |
| 142 } | 142 } |
| 143 | 143 |
| 144 void SetDevToolsWindowContentsInsets( | 144 void SetDevToolsWindowContentsBounds( |
| 145 DevToolsWindow* window, int left, int top, int right, int bottom) { | 145 DevToolsWindow* window, const gfx::Rect& bounds) { |
| 146 window->SetContentsInsets(left, top, right, bottom); | 146 window->SetInspectedPageBounds(bounds); |
| 147 } | 147 } |
| 148 | 148 |
| 149 private: | 149 private: |
| 150 DISALLOW_COPY_AND_ASSIGN(BrowserWindowControllerTest); | 150 DISALLOW_COPY_AND_ASSIGN(BrowserWindowControllerTest); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 // Tests that adding the first profile moves the Lion fullscreen button over | 153 // Tests that adding the first profile moves the Lion fullscreen button over |
| 154 // correctly. | 154 // correctly. |
| 155 // DISABLED_ because it regularly times out: http://crbug.com/159002. | 155 // DISABLED_ because it regularly times out: http://crbug.com/159002. |
| 156 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, | 156 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 EXPECT_TRUE(web_contents->GetAllowOverlappingViews()); | 368 EXPECT_TRUE(web_contents->GetAllowOverlappingViews()); |
| 369 } | 369 } |
| 370 | 370 |
| 371 // Tests that status bubble's base frame does move when devTools are docked. | 371 // Tests that status bubble's base frame does move when devTools are docked. |
| 372 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, | 372 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, |
| 373 StatusBubblePositioning) { | 373 StatusBubblePositioning) { |
| 374 NSPoint origin = [controller() statusBubbleBaseFrame].origin; | 374 NSPoint origin = [controller() statusBubbleBaseFrame].origin; |
| 375 | 375 |
| 376 DevToolsWindow* devtools_window = DevToolsWindow::OpenDevToolsWindowForTest( | 376 DevToolsWindow* devtools_window = DevToolsWindow::OpenDevToolsWindowForTest( |
| 377 browser(), true); | 377 browser(), true); |
| 378 SetDevToolsWindowContentsInsets(devtools_window, 10, 10, 10, 10); | 378 SetDevToolsWindowContentsBounds(devtools_window, gfx::Rect(10, 10, 100, 100)); |
| 379 | 379 |
| 380 NSPoint originWithDevTools = [controller() statusBubbleBaseFrame].origin; | 380 NSPoint originWithDevTools = [controller() statusBubbleBaseFrame].origin; |
| 381 EXPECT_FALSE(NSEqualPoints(origin, originWithDevTools)); | 381 EXPECT_FALSE(NSEqualPoints(origin, originWithDevTools)); |
| 382 } | 382 } |
| OLD | NEW |