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

Side by Side Diff: ui/base/window_open_disposition.h

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix weird formatting in recent_tabs_sub_menu_model.cc Created 4 years, 3 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
« no previous file with comments | « ui/base/cocoa/cocoa_base_utils_unittest.mm ('k') | ui/base/window_open_disposition.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 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 #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_base_export.h" 8 #include "ui/base/ui_base_export.h"
9 9
10 // A Java counterpart will be generated for this enum. 10 // A Java counterpart will be generated for this enum.
11 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui 11 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui
Nico 2016/08/30 18:18:39 does GENERATED_JAVA_ENUM_PACKAGE work with enum cl
ncarter (slow) 2016/08/31 17:00:10 Yes, it works (it works with enum struct, too). Th
12 enum WindowOpenDisposition { 12 enum class WindowOpenDisposition {
13 UNKNOWN, 13 UNKNOWN,
14 CURRENT_TAB, 14 CURRENT_TAB,
15 // Indicates that only one tab with the url should exist in the same window. 15 // Indicates that only one tab with the url should exist in the same window.
16 SINGLETON_TAB, 16 SINGLETON_TAB,
17 NEW_FOREGROUND_TAB, 17 NEW_FOREGROUND_TAB,
18 NEW_BACKGROUND_TAB, 18 NEW_BACKGROUND_TAB,
19 NEW_POPUP, 19 NEW_POPUP,
20 NEW_WINDOW, 20 NEW_WINDOW,
21 SAVE_TO_DISK, 21 SAVE_TO_DISK,
22 OFF_THE_RECORD, 22 OFF_THE_RECORD,
23 IGNORE_ACTION, 23 IGNORE_ACTION,
24 // Update when adding a new disposition. 24 // Update when adding a new disposition.
25 WINDOW_OPEN_DISPOSITION_LAST = IGNORE_ACTION 25 MAX_VALUE = IGNORE_ACTION
26 }; 26 };
27 27
28 namespace ui { 28 namespace ui {
29 29
30 // Translates event flags from a click on a link into the user's desired 30 // Translates event flags from a click on a link into the user's desired
31 // window disposition. For example, a middle click would mean to open 31 // window disposition. For example, a middle click would mean to open
32 // a background tab. 32 // a background tab.
33 UI_BASE_EXPORT WindowOpenDisposition DispositionFromClick(bool middle_button, 33 UI_BASE_EXPORT WindowOpenDisposition DispositionFromClick(bool middle_button,
34 bool alt_key, 34 bool alt_key,
35 bool ctrl_key, 35 bool ctrl_key,
36 bool meta_key, 36 bool meta_key,
37 bool shift_key); 37 bool shift_key);
38 38
39 // Translates event flags into what kind of disposition they represents. 39 // Translates event flags into what kind of disposition they represents.
40 // For example, a middle click would mean to open a background tab. 40 // For example, a middle click would mean to open a background tab.
41 // event_flags are the flags as understood by ui::MouseEvent. 41 // event_flags are the flags as understood by ui::MouseEvent.
42 UI_BASE_EXPORT WindowOpenDisposition DispositionFromEventFlags(int event_flags); 42 UI_BASE_EXPORT WindowOpenDisposition DispositionFromEventFlags(int event_flags);
43 43
44 } // namespace ui 44 } // namespace ui
45 45
46 #endif // UI_BASE_WINDOW_OPEN_DISPOSITION_H_ 46 #endif // UI_BASE_WINDOW_OPEN_DISPOSITION_H_
OLDNEW
« no previous file with comments | « ui/base/cocoa/cocoa_base_utils_unittest.mm ('k') | ui/base/window_open_disposition.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698