- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / declarative_webrequest / request_stage.h
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 CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_REQUEST_STAGE_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_REQUEST_STAGE_H_
7
8 namespace extensions {
9
10 // The stages of the web request during which a condition could be tested and
11 // an action could be applied. This is required because for example the response
12 // headers cannot be tested before a request has been sent. Note that currently
13 // not all stages are supported in declarative Web Request, only those marked
14 // as "active" in |kActiveStages| below.
15 enum RequestStage {
16   ON_BEFORE_REQUEST = 1 << 0,
17   ON_BEFORE_SEND_HEADERS = 1 << 1,
18   ON_SEND_HEADERS = 1 << 2,
19   ON_HEADERS_RECEIVED = 1 << 3,
20   ON_AUTH_REQUIRED = 1 << 4,
21   ON_BEFORE_REDIRECT = 1 << 5,
22   ON_RESPONSE_STARTED = 1 << 6,
23   ON_COMPLETED = 1 << 7,
24   ON_ERROR = 1 << 8
25 };
26
27 // The bitmap with active stages.
28 extern const unsigned int kActiveStages;
29
30 // The highest bit in |kActiveStages|. This allows to iterate over all active
31 // stages in a "for" loop.
32 extern const unsigned int kLastActiveStage;
33
34 }  // namespace extensions
35
36 #endif  // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_REQUEST_STAGE_H_