| 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_private.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/mac/bind_objc_block.h" | 10 #include "base/mac/bind_objc_block.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 [self updateLayoutParameters:layout]; | 228 [self updateLayoutParameters:layout]; |
| 229 [self applyLayout:layout]; | 229 [self applyLayout:layout]; |
| 230 | 230 |
| 231 [toolbarController_ setDividerOpacity:[self toolbarDividerOpacity]]; | 231 [toolbarController_ setDividerOpacity:[self toolbarDividerOpacity]]; |
| 232 | 232 |
| 233 // Will update the location of the permission bubble when showing/hiding the | 233 // Will update the location of the permission bubble when showing/hiding the |
| 234 // top level toolbar in fullscreen. | 234 // top level toolbar in fullscreen. |
| 235 PermissionBubbleManager* manager = [self permissionBubbleManager]; | 235 PermissionBubbleManager* manager = [self permissionBubbleManager]; |
| 236 if (manager) | 236 if (manager) |
| 237 manager->UpdateAnchorPosition(); | 237 manager->UpdateAnchorPosition(); |
| 238 |
| 239 browser_->GetBubbleManager()->UpdateAllBubbleAnchors(); |
| 238 } | 240 } |
| 239 | 241 |
| 240 - (void)applyTabStripLayout:(const chrome::TabStripLayout&)layout { | 242 - (void)applyTabStripLayout:(const chrome::TabStripLayout&)layout { |
| 241 // Update the presence of the window controls. | 243 // Update the presence of the window controls. |
| 242 if (layout.addCustomWindowControls) | 244 if (layout.addCustomWindowControls) |
| 243 [tabStripController_ addCustomWindowControls]; | 245 [tabStripController_ addCustomWindowControls]; |
| 244 else | 246 else |
| 245 [tabStripController_ removeCustomWindowControls]; | 247 [tabStripController_ removeCustomWindowControls]; |
| 246 | 248 |
| 247 // Update the layout of the avatar. | 249 // Update the layout of the avatar. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 [[destWindow contentView] addSubview:tabStripView]; | 391 [[destWindow contentView] addSubview:tabStripView]; |
| 390 | 392 |
| 391 [sourceWindow setWindowController:nil]; | 393 [sourceWindow setWindowController:nil]; |
| 392 [self setWindow:destWindow]; | 394 [self setWindow:destWindow]; |
| 393 [destWindow setWindowController:self]; | 395 [destWindow setWindowController:self]; |
| 394 | 396 |
| 395 // Move the status bubble over, if we have one. | 397 // Move the status bubble over, if we have one. |
| 396 if (statusBubble_) | 398 if (statusBubble_) |
| 397 statusBubble_->SwitchParentWindow(destWindow); | 399 statusBubble_->SwitchParentWindow(destWindow); |
| 398 | 400 |
| 401 browser_->GetBubbleManager()->WindowFullscreenStateChanged(); |
| 402 |
| 399 // Updates the bubble position. | 403 // Updates the bubble position. |
| 400 PermissionBubbleManager* manager = [self permissionBubbleManager]; | 404 PermissionBubbleManager* manager = [self permissionBubbleManager]; |
| 401 if (manager) | 405 if (manager) |
| 402 manager->UpdateAnchorPosition(); | 406 manager->UpdateAnchorPosition(); |
| 403 | 407 |
| 404 // Move the title over. | 408 // Move the title over. |
| 405 [destWindow setTitle:[sourceWindow title]]; | 409 [destWindow setTitle:[sourceWindow title]]; |
| 406 | 410 |
| 407 // The window needs to be onscreen before we can set its first responder. | 411 // The window needs to be onscreen before we can set its first responder. |
| 408 // Ordering the window to the front can change the active Space (either to | 412 // Ordering the window to the front can change the active Space (either to |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 return browser_->tab_strip_model()->GetActiveWebContents(); | 1162 return browser_->tab_strip_model()->GetActiveWebContents(); |
| 1159 } | 1163 } |
| 1160 | 1164 |
| 1161 - (PermissionBubbleManager*)permissionBubbleManager { | 1165 - (PermissionBubbleManager*)permissionBubbleManager { |
| 1162 if (WebContents* contents = [self webContents]) | 1166 if (WebContents* contents = [self webContents]) |
| 1163 return PermissionBubbleManager::FromWebContents(contents); | 1167 return PermissionBubbleManager::FromWebContents(contents); |
| 1164 return nil; | 1168 return nil; |
| 1165 } | 1169 } |
| 1166 | 1170 |
| 1167 @end // @implementation BrowserWindowController(Private) | 1171 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |