| 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 #include "content/browser/disposition_utils.h" | 5 #include "chrome/browser/disposition_utils.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 namespace disposition_utils { | 9 namespace disposition_utils { |
| 10 | 10 |
| 11 WindowOpenDisposition DispositionFromClick(bool middle_button, | 11 WindowOpenDisposition DispositionFromClick(bool middle_button, |
| 12 bool alt_key, | 12 bool alt_key, |
| 13 bool ctrl_key, | 13 bool ctrl_key, |
| 14 bool meta_key, | 14 bool meta_key, |
| 15 bool shift_key) { | 15 bool shift_key) { |
| 16 // MacOS uses meta key (Command key) to spawn new tabs. | 16 // MacOS uses meta key (Command key) to spawn new tabs. |
| 17 #if defined(OS_MACOSX) | 17 #if defined(OS_MACOSX) |
| 18 if (middle_button || meta_key) | 18 if (middle_button || meta_key) |
| 19 #else | 19 #else |
| 20 if (middle_button || ctrl_key) | 20 if (middle_button || ctrl_key) |
| 21 #endif | 21 #endif |
| 22 return shift_key ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; | 22 return shift_key ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; |
| 23 if (shift_key) | 23 if (shift_key) |
| 24 return NEW_WINDOW; | 24 return NEW_WINDOW; |
| 25 if (alt_key) | 25 if (alt_key) |
| 26 return SAVE_TO_DISK; | 26 return SAVE_TO_DISK; |
| 27 return CURRENT_TAB; | 27 return CURRENT_TAB; |
| 28 } | 28 } |
| 29 | 29 |
| 30 } | 30 } |
| OLD | NEW |