1 // Copyright (c) 2012 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 #ifndef COMPONENTS_NO_STATE_PREFETCH_COMMON_PRERENDER_ORIGIN_H_
6 #define COMPONENTS_NO_STATE_PREFETCH_COMMON_PRERENDER_ORIGIN_H_
7 
8 namespace prerender {
9 
10 // Origin indicates what caused the prerender.
11 // NOTE: New values need to be appended, since they are used in histograms.
12 
13 // These values are persisted to logs. Entries should not be renumbered and
14 // numeric values should never be reused. The values should remain
15 // synchronized with the enum PrerenderOrigin in
16 // //tools/metrics/histograms/enums.xml.
17 enum Origin {
18   // Obsolete: ORIGIN_LINK_REL_PRERENDER = 0,
19   // Obsolete: ORIGIN_OMNIBOX_ORIGINAL = 1,
20   ORIGIN_GWS_PRERENDER = 2,
21   // Obsolete: ORIGIN_OMNIBOX_CONSERVATIVE = 3,
22   // Obsolete: ORIGIN_OMNIBOX_EXACT = 4,
23   ORIGIN_OMNIBOX = 5,
24   ORIGIN_NONE = 6,
25   ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN = 7,
26   ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN = 8,
27   // Obsolete: ORIGIN_LOCAL_PREDICTOR = 9,
28   ORIGIN_EXTERNAL_REQUEST = 10,
29   // Obsolete: ORIGIN_INSTANT = 11,
30   ORIGIN_LINK_REL_NEXT = 12,
31   ORIGIN_EXTERNAL_REQUEST_FORCED_PRERENDER = 13,
32   // Obsolete: ORIGIN_OFFLINE = 14,
33   ORIGIN_NAVIGATION_PREDICTOR = 15,
34   ORIGIN_ISOLATED_PRERENDER = 16,
35   ORIGIN_MAX = 17,
36 };
37 
38 // Return a human-readable name for |origin|.
39 const char* NameFromOrigin(Origin origin);
40 
41 }  // namespace prerender
42 
43 #endif  // COMPONENTS_NO_STATE_PREFETCH_COMMON_PRERENDER_ORIGIN_H_
44