OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_COMMON_PAGE_TRANSITION_TYPES_H__ | 5 #ifndef CHROME_COMMON_PAGE_TRANSITION_TYPES_H__ |
6 #define CHROME_COMMON_PAGE_TRANSITION_TYPES_H__ | 6 #define CHROME_COMMON_PAGE_TRANSITION_TYPES_H__ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
11 // This class is for scoping only. | 11 // This class is for scoping only. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // wikipedia the generated url has a transition qualifer of KEYWORD, and | 87 // wikipedia the generated url has a transition qualifer of KEYWORD, and |
88 // TemplateURLModel generates a visit for 'wikipedia.org' with a transition | 88 // TemplateURLModel generates a visit for 'wikipedia.org' with a transition |
89 // type of KEYWORD_GENERATED. | 89 // type of KEYWORD_GENERATED. |
90 KEYWORD = 9, | 90 KEYWORD = 9, |
91 | 91 |
92 // Corresponds to a visit generated for a keyword. See description of | 92 // Corresponds to a visit generated for a keyword. See description of |
93 // KEYWORD for more details. | 93 // KEYWORD for more details. |
94 KEYWORD_GENERATED = 10, | 94 KEYWORD_GENERATED = 10, |
95 | 95 |
96 // ADDING NEW CORE VALUE? Be sure to update the LAST_CORE and CORE_MASK | 96 // ADDING NEW CORE VALUE? Be sure to update the LAST_CORE and CORE_MASK |
97 // values below. | 97 // values below. Also update CoreTransitionString(). |
98 LAST_CORE = KEYWORD_GENERATED, | 98 LAST_CORE = KEYWORD_GENERATED, |
99 CORE_MASK = 0xFF, | 99 CORE_MASK = 0xFF, |
100 | 100 |
101 // Qualifiers | 101 // Qualifiers |
102 // Any of the core values above can be augmented by one or more qualifiers. | 102 // Any of the core values above can be augmented by one or more qualifiers. |
103 // These qualifiers further define the transition. | 103 // These qualifiers further define the transition. |
104 | 104 |
105 // The beginning of a navigation chain. | 105 // The beginning of a navigation chain. |
106 CHAIN_START = 0x10000000, | 106 CHAIN_START = 0x10000000, |
107 | 107 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 // Simplifies the provided transition by removing any qualifier | 156 // Simplifies the provided transition by removing any qualifier |
157 static Type StripQualifier(Type type) { | 157 static Type StripQualifier(Type type) { |
158 return static_cast<Type>(type & ~QUALIFIER_MASK); | 158 return static_cast<Type>(type & ~QUALIFIER_MASK); |
159 } | 159 } |
160 | 160 |
161 // Return the qualifier | 161 // Return the qualifier |
162 static int32 GetQualifier(Type type) { | 162 static int32 GetQualifier(Type type) { |
163 return type & QUALIFIER_MASK; | 163 return type & QUALIFIER_MASK; |
164 } | 164 } |
| 165 |
| 166 // Return a string version of the core type values. |
| 167 static const char* CoreTransitionString(Type type); |
165 }; | 168 }; |
166 | 169 |
167 #endif // CHROME_COMMON_PAGE_TRANSITION_TYPES_H__ | 170 #endif // CHROME_COMMON_PAGE_TRANSITION_TYPES_H__ |
OLD | NEW |