wk_navigation_action_util.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2018 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 IOS_WEB_NAVIGATION_WK_NAVIGATION_ACTION_UTIL_H_
  5. #define IOS_WEB_NAVIGATION_WK_NAVIGATION_ACTION_UTIL_H_
  6. @class WKNavigationAction;
  7. @class NSString;
  8. namespace web {
  9. // This enum values indicates whether a WKNavigationAction was initiated by the
  10. // user or initiated by a script.
  11. enum class NavigationActionInitiationType {
  12. // This is the default value for the enum, but it will also be the case when
  13. // there is no way to detect if the navigationAction initiator by examining
  14. // the WKNavigationAction fields.
  15. kUnknownInitiator = 0,
  16. // The navigation action is a link click initiated by the user.
  17. kUserInitiated,
  18. };
  19. // Returns the WKNavigationAction initiation type.
  20. NavigationActionInitiationType GetNavigationActionInitiationType(
  21. WKNavigationAction* action);
  22. // Returns theNavigationIniationType based on the navigationAction description
  23. // string when voiceover is off.
  24. NavigationActionInitiationType
  25. GetNavigationActionInitiationTypeWithVoiceOverOff(NSString* action_description);
  26. // Returns theNavigationIniationType based on the navigationAction description
  27. // string when voiceover is on.
  28. NavigationActionInitiationType GetNavigationActionInitiationTypeWithVoiceOverOn(
  29. NSString* action_description);
  30. } // namespace web
  31. #endif // IOS_WEB_NAVIGATION_WK_NAVIGATION_ACTION_UTIL_H_