Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Side by Side Diff: content/browser/web_contents/web_contents_view_mac.mm

Issue 10436010: Multi-select <select> in 'external popup window' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
11 #import "base/mac/scoped_sending_event.h" 11 #import "base/mac/scoped_sending_event.h"
12 #import "base/message_pump_mac.h" 12 #import "base/message_pump_mac.h"
13 #include "content/browser/renderer_host/popup_menu_helper_mac.h"
13 #include "content/browser/renderer_host/render_view_host_factory.h" 14 #include "content/browser/renderer_host/render_view_host_factory.h"
14 #include "content/browser/renderer_host/render_view_host_impl.h" 15 #include "content/browser/renderer_host/render_view_host_impl.h"
15 #include "content/browser/renderer_host/render_widget_host_view_mac.h" 16 #include "content/browser/renderer_host/render_widget_host_view_mac.h"
16 #include "content/browser/web_contents/web_contents_impl.h" 17 #include "content/browser/web_contents/web_contents_impl.h"
17 #import "content/browser/web_contents/web_drag_dest_mac.h" 18 #import "content/browser/web_contents/web_drag_dest_mac.h"
18 #import "content/browser/web_contents/web_drag_source_mac.h" 19 #import "content/browser/web_contents/web_drag_source_mac.h"
19 #include "content/common/view_messages.h" 20 #include "content/common/view_messages.h"
20 #include "content/public/browser/web_contents_delegate.h" 21 #include "content/public/browser/web_contents_delegate.h"
21 #include "content/public/browser/web_contents_view_delegate.h" 22 #include "content/public/browser/web_contents_view_delegate.h"
22 #include "skia/ext/skia_utils_mac.h" 23 #include "skia/ext/skia_utils_mac.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 web_contents_->GetDelegate()->HandleContextMenu(params)) { 281 web_contents_->GetDelegate()->HandleContextMenu(params)) {
281 return; 282 return;
282 } 283 }
283 284
284 if (delegate()) 285 if (delegate())
285 delegate()->ShowContextMenu(params); 286 delegate()->ShowContextMenu(params);
286 else 287 else
287 DLOG(ERROR) << "Cannot show context menus without a delegate."; 288 DLOG(ERROR) << "Cannot show context menus without a delegate.";
288 } 289 }
289 290
291 // Display a popup menu for WebKit using Cocoa widgets.
292 void WebContentsViewMac::ShowPopupMenu(
293 const gfx::Rect& bounds,
294 int item_height,
295 double item_font_size,
296 int selected_item,
297 const std::vector<WebMenuItem>& items,
298 bool right_aligned,
299 bool allow_multiple_selection) {
300 PopupMenuHelper popup_menu_helper(web_contents_->GetRenderViewHost());
301 popup_menu_helper.ShowPopupMenu(bounds, item_height, item_font_size,
302 selected_item, items, right_aligned,
303 allow_multiple_selection);
304 }
305
290 bool WebContentsViewMac::IsEventTracking() const { 306 bool WebContentsViewMac::IsEventTracking() const {
291 return base::MessagePumpMac::IsHandlingSendEvent(); 307 return base::MessagePumpMac::IsHandlingSendEvent();
292 } 308 }
293 309
294 // Arrange to call CloseTab() after we're back to the main event loop. 310 // Arrange to call CloseTab() after we're back to the main event loop.
295 // The obvious way to do this would be PostNonNestableTask(), but that 311 // The obvious way to do this would be PostNonNestableTask(), but that
296 // will fire when the event-tracking loop polls for events. So we 312 // will fire when the event-tracking loop polls for events. So we
297 // need to bounce the message via Cocoa, instead. 313 // need to bounce the message via Cocoa, instead.
298 void WebContentsViewMac::CloseTabAfterEventTracking() { 314 void WebContentsViewMac::CloseTabAfterEventTracking() {
299 [cocoa_view_ cancelDeferredClose]; 315 [cocoa_view_ cancelDeferredClose];
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 [[[notification userInfo] objectForKey:kSelectionDirection] 510 [[[notification userInfo] objectForKey:kSelectionDirection]
495 unsignedIntegerValue]; 511 unsignedIntegerValue];
496 if (direction == NSDirectSelection) 512 if (direction == NSDirectSelection)
497 return; 513 return;
498 514
499 [self webContents]-> 515 [self webContents]->
500 FocusThroughTabTraversal(direction == NSSelectingPrevious); 516 FocusThroughTabTraversal(direction == NSSelectingPrevious);
501 } 517 }
502 518
503 @end 519 @end
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_view_mac.h ('k') | content/browser/web_contents/web_contents_view_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698