| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 bool navigationPolicyFromMouseEvent(unsigned short button, bool ctrl, bool shift
, bool alt, bool meta, NavigationPolicy* policy) | 37 bool navigationPolicyFromMouseEvent(unsigned short button, bool ctrl, bool shift
, bool alt, bool meta, NavigationPolicy* policy) |
| 38 { | 38 { |
| 39 #if OS(MACOSX) | 39 #if OS(MACOSX) |
| 40 const bool newTabModifier = (button == 1) || meta; | 40 const bool newTabModifier = (button == 1) || meta; |
| 41 #else | 41 #else |
| 42 const bool newTabModifier = (button == 1) || ctrl; | 42 const bool newTabModifier = (button == 1) || ctrl; |
| 43 #endif | 43 #endif |
| 44 if (!newTabModifier && !shift && !alt) | 44 if (!newTabModifier && !shift && !alt) |
| 45 return false; | 45 return false; |
| 46 | 46 |
| 47 ASSERT(policy); | 47 DCHECK(policy); |
| 48 if (newTabModifier) { | 48 if (newTabModifier) { |
| 49 if (shift) | 49 if (shift) |
| 50 *policy = NavigationPolicyNewForegroundTab; | 50 *policy = NavigationPolicyNewForegroundTab; |
| 51 else | 51 else |
| 52 *policy = NavigationPolicyNewBackgroundTab; | 52 *policy = NavigationPolicyNewBackgroundTab; |
| 53 } else { | 53 } else { |
| 54 if (shift) | 54 if (shift) |
| 55 *policy = NavigationPolicyNewWindow; | 55 *policy = NavigationPolicyNewWindow; |
| 56 else | 56 else |
| 57 *policy = NavigationPolicyDownload; | 57 *policy = NavigationPolicyDownload; |
| 58 } | 58 } |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace blink | 62 } // namespace blink |
| 63 | 63 |
| OLD | NEW |