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

Side by Side Diff: webkit/glue/webframeloaderclient_impl.cc

Issue 56150: Switch the new tab key to command on the Mac. Popping new tabs still doesn't ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #include "config.h" 5 #include "config.h"
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 10
(...skipping 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 } 1556 }
1557 1557
1558 bool WebFrameLoaderClient::ActionSpecifiesDisposition( 1558 bool WebFrameLoaderClient::ActionSpecifiesDisposition(
1559 const WebCore::NavigationAction& action, 1559 const WebCore::NavigationAction& action,
1560 WindowOpenDisposition* disposition) { 1560 WindowOpenDisposition* disposition) {
1561 if ((action.type() != NavigationTypeLinkClicked) || 1561 if ((action.type() != NavigationTypeLinkClicked) ||
1562 !action.event()->isMouseEvent()) 1562 !action.event()->isMouseEvent())
1563 return false; 1563 return false;
1564 1564
1565 const MouseEvent* event = static_cast<const MouseEvent*>(action.event()); 1565 const MouseEvent* event = static_cast<const MouseEvent*>(action.event());
1566 const bool middle_or_ctrl = (event->button() == 1) || event->ctrlKey(); 1566 #if defined(OS_WIN) || defined(OS_LINUX)
1567 const bool new_tab_modifier = (event->button() == 1) || event->ctrlKey();
1568 #elif defined(OS_MACOSX)
1569 const bool new_tab_modifier = (event->button() == 1) || event->metaKey();
1570 #endif
1567 const bool shift = event->shiftKey(); 1571 const bool shift = event->shiftKey();
1568 const bool alt = event->altKey(); 1572 const bool alt = event->altKey();
1569 if (!middle_or_ctrl && !shift && !alt) 1573 if (!new_tab_modifier && !shift && !alt)
1570 return false; 1574 return false;
1571 1575
1572 DCHECK(disposition); 1576 DCHECK(disposition);
1573 if (middle_or_ctrl) 1577 if (new_tab_modifier)
1574 *disposition = shift ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; 1578 *disposition = shift ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB;
1575 else 1579 else
1576 *disposition = shift ? NEW_WINDOW : SAVE_TO_DISK; 1580 *disposition = shift ? NEW_WINDOW : SAVE_TO_DISK;
1577 return true; 1581 return true;
1578 } 1582 }
1579 1583
1580 NetAgentImpl* WebFrameLoaderClient::GetNetAgentImpl() { 1584 NetAgentImpl* WebFrameLoaderClient::GetNetAgentImpl() {
1581 WebViewImpl* web_view = webframe_->webview_impl(); 1585 WebViewImpl* web_view = webframe_->webview_impl();
1582 if (!web_view) { 1586 if (!web_view) {
1583 return NULL; 1587 return NULL;
1584 } 1588 }
1585 WebDevToolsAgentImpl* tools_agent = web_view->GetWebDevToolsAgentImpl(); 1589 WebDevToolsAgentImpl* tools_agent = web_view->GetWebDevToolsAgentImpl();
1586 if (tools_agent) { 1590 if (tools_agent) {
1587 return tools_agent->net_agent_impl(); 1591 return tools_agent->net_agent_impl();
1588 } else { 1592 } else {
1589 return NULL; 1593 return NULL;
1590 } 1594 }
1591 } 1595 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698