| 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 <Carbon/Carbon.h> | 5 #import <Carbon/Carbon.h> |
| 6 | 6 |
| 7 #import "content/browser/tab_contents/web_contents_view_mac.h" | 7 #import "content/browser/tab_contents/web_contents_view_mac.h" |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 gfx::Rect()); | 337 gfx::Rect()); |
| 338 | 338 |
| 339 // A RenderWidgetHostViewMac has lifetime scoped to the view. Now that it's | 339 // A RenderWidgetHostViewMac has lifetime scoped to the view. Now that it's |
| 340 // properly embedded (or purposely ignored) we can release the retain we took | 340 // properly embedded (or purposely ignored) we can release the retain we took |
| 341 // in CreateNewFullscreenWidgetInternal(). | 341 // in CreateNewFullscreenWidgetInternal(). |
| 342 RenderWidgetHostViewMac* widget_view_mac = | 342 RenderWidgetHostViewMac* widget_view_mac = |
| 343 static_cast<RenderWidgetHostViewMac*>(widget_host_view); | 343 static_cast<RenderWidgetHostViewMac*>(widget_host_view); |
| 344 [widget_view_mac->GetNativeView() release]; | 344 [widget_view_mac->GetNativeView() release]; |
| 345 } | 345 } |
| 346 | 346 |
| 347 void WebContentsViewMac::ShowContextMenu(const ContextMenuParams& params) { | 347 void WebContentsViewMac::ShowContextMenu( |
| 348 const content::ContextMenuParams& params) { |
| 348 // Allow delegates to handle the context menu operation first. | 349 // Allow delegates to handle the context menu operation first. |
| 349 if (tab_contents_->GetDelegate() && | 350 if (tab_contents_->GetDelegate() && |
| 350 tab_contents_->GetDelegate()->HandleContextMenu(params)) { | 351 tab_contents_->GetDelegate()->HandleContextMenu(params)) { |
| 351 return; | 352 return; |
| 352 } | 353 } |
| 353 | 354 |
| 354 if (delegate()) | 355 if (delegate()) |
| 355 delegate()->ShowContextMenu(params); | 356 delegate()->ShowContextMenu(params); |
| 356 else | 357 else |
| 357 DLOG(ERROR) << "Cannot show context menus without a delegate."; | 358 DLOG(ERROR) << "Cannot show context menus without a delegate."; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 [[[notification userInfo] objectForKey:kSelectionDirection] | 604 [[[notification userInfo] objectForKey:kSelectionDirection] |
| 604 unsignedIntegerValue]; | 605 unsignedIntegerValue]; |
| 605 if (direction == NSDirectSelection) | 606 if (direction == NSDirectSelection) |
| 606 return; | 607 return; |
| 607 | 608 |
| 608 [self tabContents]-> | 609 [self tabContents]-> |
| 609 FocusThroughTabTraversal(direction == NSSelectingPrevious); | 610 FocusThroughTabTraversal(direction == NSSelectingPrevious); |
| 610 } | 611 } |
| 611 | 612 |
| 612 @end | 613 @end |
| OLD | NEW |