Home | History | Annotate | Download | only in common
      1 // Copyright (c) 2011 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 #pragma once
      8 
      9 namespace automation {
     10 
     11 // JSON value labels for proxy settings that are passed in via
     12 // AutomationMsg_SetProxyConfig. These are here since they are used by both
     13 // AutomationProvider and AutomationProxy.
     14 extern const char kJSONProxyAutoconfig[];
     15 extern const char kJSONProxyNoProxy[];
     16 extern const char kJSONProxyPacUrl[];
     17 extern const char kJSONProxyBypassList[];
     18 extern const char kJSONProxyServer[];
     19 
     20 // When passing the kTestingChannelID switch to the browser, prepend
     21 // this prefix to the channel id to enable the named testing interface.
     22 // Named testing interface is used when you want to connect an
     23 // AutomationProxy to an already-running browser instance.
     24 extern const char kNamedInterfacePrefix[];
     25 
     26 // Amount of time to wait before querying the browser.
     27 static const int kSleepTime = 250;
     28 
     29 // Recognized by the AutomationProvider's SendWebKeyboardEventToSelectedTab
     30 // command. Specifies the type of the keyboard event.
     31 enum KeyEventTypes {
     32   kRawKeyDownType = 0,
     33   kKeyDownType,
     34   kCharType,
     35   kKeyUpType,
     36 };
     37 
     38 // Recognized by the AutomationProvider's SendWebKeyboardEventToSelectedTab
     39 // command. Specifies masks to be used in constructing keyboard event modifiers.
     40 enum KeyModifierMasks {
     41   kShiftKeyMask   = 1 << 0,
     42   kControlKeyMask = 1 << 1,
     43   kAltKeyMask     = 1 << 2,
     44   kMetaKeyMask    = 1 << 3,
     45 };
     46 
     47 enum MouseButton {
     48   kLeftButton = 0,
     49   kMiddleButton,
     50   kRightButton,
     51 };
     52 
     53 // The current version of ChromeDriver automation supported by Chrome.
     54 // This needs to be incremented for each change to ChromeDriver automation that
     55 // is not backwards compatible. Some examples of this would be:
     56 // - SendJSONRequest or Hello IPC messages change
     57 // - The interface for an individual ChromeDriver automation call changes in an
     58 //   incompatible way
     59 // TODO(kkania): Investigate a better backwards compatible automation solution.
     60 extern const int kChromeDriverAutomationVersion;
     61 
     62 }  // namespace automation
     63 
     64 // Used by AutomationProxy, declared here so that other headers don't need
     65 // to include automation_proxy.h.
     66 enum AutomationLaunchResult {
     67   AUTOMATION_LAUNCH_RESULT_INVALID = -1,
     68   AUTOMATION_SUCCESS,
     69   AUTOMATION_TIMEOUT,
     70   AUTOMATION_VERSION_MISMATCH,
     71   AUTOMATION_CREATE_TAB_FAILED,
     72   AUTOMATION_SERVER_CRASHED,
     73 };
     74 
     75 enum AutomationMsg_NavigationResponseValues {
     76   AUTOMATION_MSG_NAVIGATION_ERROR = 0,
     77   AUTOMATION_MSG_NAVIGATION_SUCCESS,
     78   AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
     79 };
     80 
     81 enum AutomationMsg_ExtensionResponseValues {
     82   AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED = 0,
     83   AUTOMATION_MSG_EXTENSION_INSTALL_FAILED
     84 };
     85 
     86 // Used in the AutomationMsg_GetExtensionProperty to identify which extension
     87 // property should be retrieved, instead of having separate messages for each
     88 // property.
     89 enum AutomationMsg_ExtensionProperty {
     90   AUTOMATION_MSG_EXTENSION_ID = 0,
     91   AUTOMATION_MSG_EXTENSION_NAME,
     92   AUTOMATION_MSG_EXTENSION_VERSION,
     93   AUTOMATION_MSG_EXTENSION_BROWSER_ACTION_INDEX,
     94 };
     95 
     96 
     97 #endif  // CHROME_COMMON_AUTOMATION_CONSTANTS_H__
     98