| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" | 7 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 321 |
| 322 // A RenderWidgetHostViewMac has lifetime scoped to the view. Now that it's | 322 // A RenderWidgetHostViewMac has lifetime scoped to the view. Now that it's |
| 323 // properly embedded (or purposely ignored) we can release the retain we took | 323 // properly embedded (or purposely ignored) we can release the retain we took |
| 324 // in CreateNewFullscreenWidgetInternal(). | 324 // in CreateNewFullscreenWidgetInternal(). |
| 325 RenderWidgetHostViewMac* widget_view_mac = | 325 RenderWidgetHostViewMac* widget_view_mac = |
| 326 static_cast<RenderWidgetHostViewMac*>(widget_host_view); | 326 static_cast<RenderWidgetHostViewMac*>(widget_host_view); |
| 327 [widget_view_mac->native_view() release]; | 327 [widget_view_mac->native_view() release]; |
| 328 } | 328 } |
| 329 | 329 |
| 330 void TabContentsViewMac::ShowContextMenu(const ContextMenuParams& params) { | 330 void TabContentsViewMac::ShowContextMenu(const ContextMenuParams& params) { |
| 331 RenderViewContextMenuMac menu(tab_contents_, | 331 context_menu_.reset(new RenderViewContextMenuMac(tab_contents(), |
| 332 params, | 332 params, |
| 333 GetContentNativeView()); | 333 GetContentNativeView())); |
| 334 menu.Init(); | 334 context_menu_->Init(); |
| 335 } | 335 } |
| 336 | 336 |
| 337 // Display a popup menu for WebKit using Cocoa widgets. | 337 // Display a popup menu for WebKit using Cocoa widgets. |
| 338 void TabContentsViewMac::ShowPopupMenu( | 338 void TabContentsViewMac::ShowPopupMenu( |
| 339 const gfx::Rect& bounds, | 339 const gfx::Rect& bounds, |
| 340 int item_height, | 340 int item_height, |
| 341 double item_font_size, | 341 double item_font_size, |
| 342 int selected_item, | 342 int selected_item, |
| 343 const std::vector<WebMenuItem>& items, | 343 const std::vector<WebMenuItem>& items, |
| 344 bool right_aligned) { | 344 bool right_aligned) { |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 [[[notification userInfo] objectForKey:kSelectionDirection] | 561 [[[notification userInfo] objectForKey:kSelectionDirection] |
| 562 unsignedIntegerValue]; | 562 unsignedIntegerValue]; |
| 563 if (direction == NSDirectSelection) | 563 if (direction == NSDirectSelection) |
| 564 return; | 564 return; |
| 565 | 565 |
| 566 [self tabContents]-> | 566 [self tabContents]-> |
| 567 FocusThroughTabTraversal(direction == NSSelectingPrevious); | 567 FocusThroughTabTraversal(direction == NSSelectingPrevious); |
| 568 } | 568 } |
| 569 | 569 |
| 570 @end | 570 @end |
| OLD | NEW |