omnibox_focus_type.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2020 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. #ifndef COMPONENTS_SEARCH_ENGINES_OMNIBOX_FOCUS_TYPE_H_
  5. #define COMPONENTS_SEARCH_ENGINES_OMNIBOX_FOCUS_TYPE_H_
  6. // For search requests, this enum specifies how the user last interacted with
  7. // the UI control. This is used for both the omnibox and NTP realbox.
  8. //
  9. // At this point, it's a bit of a misnomer to call it OmniboxFocusType, since
  10. // the enum now covers UI interactions unrelated to focus. But we are keeping
  11. // the old name to match the "oft" GET param.
  12. //
  13. // These values are used as HTTP GET parameter values. Entries should not be
  14. // renumbered and numeric values should never be reused.
  15. enum class OmniboxFocusType {
  16. // The default value. This is used for any search requests without any
  17. // special interaction annotation, including: normal omnibox searches,
  18. // as-you-type omnibox suggestions, as well as non-omnibox searches.
  19. DEFAULT = 0,
  20. // This search request is triggered by the user focusing the omnibox.
  21. ON_FOCUS = 1,
  22. // This search request is triggered by the user deleting all of the
  23. // omnibox permanent text at once, i.e. user is on "https://example.com",
  24. // does Ctrl+L which selects the whole URL, then presses Backspace.
  25. //
  26. // Note, DELETED_PERMANENT_TEXT only applies in fairly limited circumstances.
  27. // For example, these cases would NOT qualify, are instead marked DEFAULT:
  28. // - User deletes their own typed text.
  29. // - User deletes the permanent text one character at a time.
  30. // - User uses Cut (Ctrl+X) to delete the permanent text.
  31. DELETED_PERMANENT_TEXT = 2,
  32. };
  33. #endif // COMPONENTS_SEARCH_ENGINES_OMNIBOX_FOCUS_TYPE_H_