Skip to content

Commit dd5b713

Browse files
committed
Change TransitionType to an unit enum
Add [Falgs] attribute as TransitionType can have multiple values Import values from cef_transition_type_t (cef_types.h) Rename some of the values (slightly friendlier names)
1 parent dece1de commit dd5b713

File tree

1 file changed

+94
-8
lines changed

1 file changed

+94
-8
lines changed

CefSharp/TransitionType.cs

Lines changed: 94 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,98 @@
1-
namespace CefSharp
1+
using System;
2+
3+
namespace CefSharp
24
{
3-
public enum TransitionType
5+
[Flags]
6+
public enum TransitionType : uint
47
{
5-
LinkClicked,
6-
FormSubmitted,
7-
BackForward,
8-
Reload,
9-
FormResubmitted,
10-
Other
8+
/// <summary>
9+
/// Source is a link click or the JavaScript window.open function. This is
10+
/// also the default value for requests like sub-resource loads that are not navigations.
11+
/// </summary>
12+
LinkClicked = 0,
13+
14+
/// <summary>
15+
/// Source is some other "explicit" navigation action such as creating a new
16+
/// browser or using the LoadURL function. This is also the default value
17+
/// for navigations where the actual type is unknown.
18+
/// </summary>
19+
Explicit = 1,
20+
21+
/// <summary>
22+
/// Source is a subframe navigation. This is any content that is automatically
23+
/// loaded in a non-toplevel frame. For example, if a page consists of several
24+
/// frames containing ads, those ad URLs will have this transition type.
25+
/// The user may not even realize the content in these pages is a separate
26+
/// frame, so may not care about the URL.
27+
/// </summary>
28+
AutoSubFrame = 3,
29+
30+
/// <summary>
31+
/// Source is a subframe navigation explicitly requested by the user that will
32+
/// generate new navigation entries in the back/forward list. These are
33+
/// probably more important than frames that were automatically loaded in
34+
/// the background because the user probably cares about the fact that this
35+
/// link was loaded.
36+
/// </summary>
37+
ManualSubFrame = 4,
38+
39+
/// <summary>
40+
/// Source is a form submission by the user. NOTE: In some situations
41+
/// submitting a form does not result in this transition type. This can happen
42+
/// if the form uses a script to submit the contents.
43+
/// </summary>
44+
FormSubmit = 7,
45+
46+
/// <summary>
47+
/// Source is a "reload" of the page via the Reload function or by re-visiting
48+
/// the same URL. NOTE: This is distinct from the concept of whether a
49+
/// particular load uses "reload semantics" (i.e. bypasses cached data).
50+
/// </summary>
51+
Reload = 8,
52+
53+
/// <summary>
54+
/// General mask defining the bits used for the source values.
55+
/// </summary>
56+
SourceMask = 0xFF,
57+
58+
/// <summary>
59+
/// Attempted to visit a URL but was blocked.
60+
/// </summary>
61+
Blocked = 0x00800000,
62+
63+
/// <summary>
64+
/// Used the Forward or Back function to navigate among browsing history.
65+
/// </summary>
66+
ForwardBack = 0x01000000,
67+
68+
/// <summary>
69+
/// The beginning of a navigation chain.
70+
/// </summary>
71+
ChainStart = 0x10000000,
72+
73+
/// <summary>
74+
/// The last transition in a redirect chain.
75+
/// </summary>
76+
ChainEnd = 0x20000000,
77+
78+
/// <summary>
79+
/// Redirects caused by JavaScript or a meta refresh tag on the page.
80+
/// </summary>
81+
CliendRedirect = 0x40000000,
82+
83+
/// <summary>
84+
/// Redirects sent from the server by HTTP headers.
85+
/// </summary>
86+
ServerRedirect = 0x80000000,
87+
88+
/// <summary>
89+
/// Used to test whether a transition involves a redirect.
90+
/// </summary>
91+
IsRedirect = 0xC0000000,
92+
93+
/// <summary>
94+
/// General mask defining the bits used for the qualifiers.
95+
/// </summary>
96+
QualifierMask = 0xFFFFFF00
1197
};
1298
}

0 commit comments

Comments
 (0)