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