chrome_notification_types.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. // Copyright 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. #ifndef CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_
  5. #define CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_
  6. #include "build/build_config.h"
  7. #include "build/chromeos_buildflags.h"
  8. #include "extensions/buildflags/buildflags.h"
  9. #if BUILDFLAG(ENABLE_EXTENSIONS)
  10. #include "extensions/browser/notification_types.h"
  11. #else
  12. #include "content/public/browser/notification_types.h"
  13. #endif
  14. #if BUILDFLAG(ENABLE_EXTENSIONS)
  15. #define PREVIOUS_END extensions::NOTIFICATION_EXTENSIONS_END
  16. #else
  17. #define PREVIOUS_END content::NOTIFICATION_CONTENT_END
  18. #endif
  19. // **
  20. // ** NOTICE
  21. // **
  22. // ** The notification system is deprecated, obsolete, and is slowly being
  23. // ** removed. See https://crbug.com/268984.
  24. // **
  25. // ** Please don't add any new notification types, and please help migrate
  26. // ** existing uses of the notification types below to use the Observer and
  27. // ** Callback patterns.
  28. // **
  29. namespace chrome {
  30. enum NotificationType {
  31. NOTIFICATION_CHROME_START = PREVIOUS_END,
  32. // Application-wide ----------------------------------------------------------
  33. // This message is sent when the application is terminating (the last
  34. // browser window has shutdown as part of an explicit user-initiated exit,
  35. // or the user closed the last browser window on Windows/Linux and there are
  36. // no BackgroundContents keeping the browser running). No source or details
  37. // are passed.
  38. // TODO(https://crbug.com/1174781): Remove.
  39. NOTIFICATION_APP_TERMINATING = NOTIFICATION_CHROME_START,
  40. // Authentication ----------------------------------------------------------
  41. // This is sent when a login prompt is shown. The source is the
  42. // Source<NavigationController> for the tab in which the prompt is shown.
  43. // Details are a LoginNotificationDetails which provide the LoginHandler
  44. // that should be given authentication.
  45. // TODO(https://crbug.com/1174785): Remove.
  46. NOTIFICATION_AUTH_NEEDED,
  47. // This is sent when authentication credentials have been supplied (either
  48. // by the user or by an automation service), but before we've actually
  49. // received another response from the server. The source is the
  50. // Source<NavigationController> for the tab in which the prompt was shown.
  51. // Details are an AuthSuppliedLoginNotificationDetails which provide the
  52. // LoginHandler that should be given authentication as well as the supplied
  53. // username and password.
  54. // TODO(https://crbug.com/1174785): Remove.
  55. NOTIFICATION_AUTH_SUPPLIED,
  56. // This is sent when an authentication request has been dismissed without
  57. // supplying credentials (either by the user or by an automation service).
  58. // The source is the Source<NavigationController> for the tab in which the
  59. // prompt was shown. Details are a LoginNotificationDetails which provide
  60. // the LoginHandler that should be cancelled.
  61. // TODO(https://crbug.com/1174785): Remove.
  62. NOTIFICATION_AUTH_CANCELLED,
  63. // Profiles -----------------------------------------------------------------
  64. // Use ProfileManagerObserver::OnProfileAdded instead of this notification.
  65. // Sent after a Profile has been added to ProfileManager.
  66. // The details are none and the source is the new profile.
  67. // Note: this notification is only sent for profiles owned by the
  68. // `ProfileManager`. In particular, off-the-record profiles don't trigger this
  69. // notification, but on-the-record System and Guest profiles do.
  70. // TODO(https://crbug.com/1174720): Remove. See also
  71. // https://crbug.com/1038437.
  72. NOTIFICATION_PROFILE_ADDED,
  73. // Misc --------------------------------------------------------------------
  74. // Note:-
  75. // Currently only Content and Chrome define and use notifications.
  76. // Custom notifications not belonging to Content and Chrome should start
  77. // from here.
  78. NOTIFICATION_CHROME_END,
  79. };
  80. } // namespace chrome
  81. // **
  82. // ** NOTICE
  83. // **
  84. // ** The notification system is deprecated, obsolete, and is slowly being
  85. // ** removed. See https://crbug.com/268984.
  86. // **
  87. // ** Please don't add any new notification types, and please help migrate
  88. // ** existing uses of the notification types below to use the Observer and
  89. // ** Callback patterns.
  90. // **
  91. #endif // CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_