| 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/web_contents/web_contents_view_mac.h" | 7 #import "content/browser/web_contents/web_contents_view_mac.h" |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 void WebContentsViewMac::TakeFocus(bool reverse) { | 275 void WebContentsViewMac::TakeFocus(bool reverse) { |
| 276 if (reverse) { | 276 if (reverse) { |
| 277 [[cocoa_view_ window] selectPreviousKeyView:cocoa_view_.get()]; | 277 [[cocoa_view_ window] selectPreviousKeyView:cocoa_view_.get()]; |
| 278 } else { | 278 } else { |
| 279 [[cocoa_view_ window] selectNextKeyView:cocoa_view_.get()]; | 279 [[cocoa_view_ window] selectNextKeyView:cocoa_view_.get()]; |
| 280 } | 280 } |
| 281 } | 281 } |
| 282 | 282 |
| 283 void WebContentsViewMac::ShowContextMenu( | 283 void WebContentsViewMac::ShowContextMenu( |
| 284 const content::ContextMenuParams& params, | 284 const content::ContextMenuParams& params, |
| 285 const content::ContextMenuSourceType& type) { | 285 content::ContextMenuSourceType type) { |
| 286 // Allow delegates to handle the context menu operation first. | 286 // Allow delegates to handle the context menu operation first. |
| 287 if (web_contents_->GetDelegate() && | 287 if (web_contents_->GetDelegate() && |
| 288 web_contents_->GetDelegate()->HandleContextMenu(params)) { | 288 web_contents_->GetDelegate()->HandleContextMenu(params)) { |
| 289 return; | 289 return; |
| 290 } | 290 } |
| 291 | 291 |
| 292 if (delegate()) | 292 if (delegate()) |
| 293 delegate()->ShowContextMenu(params, type); | 293 delegate()->ShowContextMenu(params, type); |
| 294 else | 294 else |
| 295 DLOG(ERROR) << "Cannot show context menus without a delegate."; | 295 DLOG(ERROR) << "Cannot show context menus without a delegate."; |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 [[[notification userInfo] objectForKey:kSelectionDirection] | 530 [[[notification userInfo] objectForKey:kSelectionDirection] |
| 531 unsignedIntegerValue]; | 531 unsignedIntegerValue]; |
| 532 if (direction == NSDirectSelection) | 532 if (direction == NSDirectSelection) |
| 533 return; | 533 return; |
| 534 | 534 |
| 535 [self webContents]-> | 535 [self webContents]-> |
| 536 FocusThroughTabTraversal(direction == NSSelectingPrevious); | 536 FocusThroughTabTraversal(direction == NSSelectingPrevious); |
| 537 } | 537 } |
| 538 | 538 |
| 539 @end | 539 @end |
| OLD | NEW |