OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
sky
2013/08/06 14:20:08
You don't need to update copyright year.
| |
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 #ifndef UI_BASE_WINDOW_OPEN_DISPOSITION_H_ | 5 #ifndef UI_BASE_WINDOW_OPEN_DISPOSITION_H_ |
6 #define UI_BASE_WINDOW_OPEN_DISPOSITION_H_ | 6 #define UI_BASE_WINDOW_OPEN_DISPOSITION_H_ |
7 | 7 |
8 #include "ui/base/ui_export.h" | 8 #include "ui/base/ui_export.h" |
9 | 9 |
10 enum WindowOpenDisposition { | 10 enum WindowOpenDisposition { |
11 UNKNOWN, | 11 |
12 SUPPRESS_OPEN, | 12 #define WINDOW_OPEN_DISPOSITION(label, value) label = value, |
13 CURRENT_TAB, | 13 #include "window_open_disposition_list.h" |
14 // Indicates that only one tab with the url should exist in the same window. | 14 #undef WINDOW_OPEN_DISPOSITION |
15 SINGLETON_TAB, | 15 |
16 NEW_FOREGROUND_TAB, | |
17 NEW_BACKGROUND_TAB, | |
18 NEW_POPUP, | |
19 NEW_WINDOW, | |
20 SAVE_TO_DISK, | |
21 OFF_THE_RECORD, | |
22 IGNORE_ACTION | |
23 }; | 16 }; |
24 | 17 |
25 namespace ui { | 18 namespace ui { |
26 | 19 |
27 // Translates event flags from a click on a link into the user's desired | 20 // Translates event flags from a click on a link into the user's desired |
28 // window disposition. For example, a middle click would mean to open | 21 // window disposition. For example, a middle click would mean to open |
29 // a background tab. | 22 // a background tab. |
30 UI_EXPORT WindowOpenDisposition DispositionFromClick(bool middle_button, | 23 UI_EXPORT WindowOpenDisposition DispositionFromClick(bool middle_button, |
31 bool alt_key, | 24 bool alt_key, |
32 bool ctrl_key, | 25 bool ctrl_key, |
33 bool meta_key, | 26 bool meta_key, |
34 bool shift_key); | 27 bool shift_key); |
35 | 28 |
36 // Translates event flags into what kind of disposition they represents. | 29 // Translates event flags into what kind of disposition they represents. |
37 // For example, a middle click would mean to open a background tab. | 30 // For example, a middle click would mean to open a background tab. |
38 // event_flags are the flags as understood by ui::MouseEvent. | 31 // event_flags are the flags as understood by ui::MouseEvent. |
39 UI_EXPORT WindowOpenDisposition DispositionFromEventFlags(int event_flags); | 32 UI_EXPORT WindowOpenDisposition DispositionFromEventFlags(int event_flags); |
40 | 33 |
41 } // namespace ui | 34 } // namespace ui |
42 | 35 |
43 #endif // UI_BASE_WINDOW_OPEN_DISPOSITION_H_ | 36 #endif // UI_BASE_WINDOW_OPEN_DISPOSITION_H_ |
OLD | NEW |