Home | History | Annotate | Download | only in common
      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_COMMON_AUTOMATION_CONSTANTS_H__
      6 #define CHROME_COMMON_AUTOMATION_CONSTANTS_H__
      7 
      8 #include <string>
      9 
     10 namespace automation {
     11 
     12 // JSON value labels for proxy settings that are passed in via
     13 // AutomationMsg_SetProxyConfig. These are here since they are used by both
     14 // AutomationProvider and AutomationProxy.
     15 extern const char kJSONProxyAutoconfig[];
     16 extern const char kJSONProxyNoProxy[];
     17 extern const char kJSONProxyPacUrl[];
     18 extern const char kJSONProxyPacMandatory[];
     19 extern const char kJSONProxyBypassList[];
     20 extern const char kJSONProxyServer[];
     21 
     22 // When passing the kTestingChannelID switch to the browser, prepend
     23 // this prefix to the channel id to enable the named testing interface.
     24 // Named testing interface is used when you want to connect an
     25 // AutomationProxy to an already-running browser instance.
     26 extern const char kNamedInterfacePrefix[];
     27 
     28 // Amount of time to wait before querying the browser.
     29 static const int kSleepTime = 250;
     30 
     31 // Recognized by the AutomationProvider's SendWebKeyboardEventToSelectedTab
     32 // command. Specifies the type of the keyboard event.
     33 enum KeyEventTypes {
     34   kRawKeyDownType = 0,
     35   kKeyDownType,
     36   kCharType,
     37   kKeyUpType,
     38 };
     39 
     40 // Recognized by the AutomationProvider's SendWebKeyboardEventToSelectedTab
     41 // command. Specifies masks to be used in constructing keyboard event modifiers.
     42 enum KeyModifierMasks {
     43   kShiftKeyMask   = 1 << 0,
     44   kControlKeyMask = 1 << 1,
     45   kAltKeyMask     = 1 << 2,
     46   kMetaKeyMask    = 1 << 3,
     47   kNumLockKeyMask = 1 << 4,
     48 };
     49 
     50 // Recognized by the AutomationProvider's ProcessWebMouseEvent command.
     51 enum MouseEventType {
     52   kMouseDown = 0,
     53   kMouseUp,
     54   kMouseMove,
     55   kMouseEnter,
     56   kMouseLeave,
     57   kContextMenu,
     58 };
     59 
     60 enum MouseButton {
     61   kLeftButton = 0,
     62   kMiddleButton,
     63   kRightButton,
     64   kNoButton,
     65 };
     66 
     67 }  // namespace automation
     68 
     69 // Used by AutomationProxy, declared here so that other headers don't need
     70 // to include automation_proxy.h.
     71 enum AutomationLaunchResult {
     72   AUTOMATION_LAUNCH_RESULT_INVALID = -1,
     73   AUTOMATION_SUCCESS,
     74   AUTOMATION_TIMEOUT,
     75   AUTOMATION_VERSION_MISMATCH,
     76   AUTOMATION_CREATE_TAB_FAILED,
     77   AUTOMATION_SERVER_CRASHED,
     78   AUTOMATION_CHANNEL_ERROR,
     79 };
     80 
     81 enum AutomationMsg_NavigationResponseValues {
     82   AUTOMATION_MSG_NAVIGATION_ERROR = 0,
     83   AUTOMATION_MSG_NAVIGATION_SUCCESS,
     84   AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
     85   AUTOMATION_MSG_NAVIGATION_BLOCKED_BY_MODAL_DIALOG,
     86 };
     87 
     88 // Used in the AutomationMsg_GetExtensionProperty to identify which extension
     89 // property should be retrieved, instead of having separate messages for each
     90 // property.
     91 enum AutomationMsg_DEPRECATED_ExtensionProperty {
     92   AUTOMATION_MSG_EXTENSION_ID = 0,
     93   AUTOMATION_MSG_EXTENSION_NAME,
     94   AUTOMATION_MSG_EXTENSION_VERSION,
     95   AUTOMATION_MSG_EXTENSION_BROWSER_ACTION_INDEX,
     96 };
     97 
     98 // Specifies the font size on a page which is requested by an automation
     99 // client.
    100 enum AutomationPageFontSize {
    101   SMALLEST_FONT = 8,
    102   SMALL_FONT = 12,
    103   MEDIUM_FONT = 16,
    104   LARGE_FONT = 24,
    105   LARGEST_FONT = 36
    106 };
    107 
    108 enum FindInPageDirection { BACK = 0, FWD = 1 };
    109 enum FindInPageCase { IGNORE_CASE = 0, CASE_SENSITIVE = 1 };
    110 
    111 #endif  // CHROME_COMMON_AUTOMATION_CONSTANTS_H__
    112