view_android_observer.h 925 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2017 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 UI_ANDROID_VIEW_ANDROID_OBSERVER_H_
  5. #define UI_ANDROID_VIEW_ANDROID_OBSERVER_H_
  6. #include "ui/android/ui_android_export.h"
  7. namespace ui {
  8. class UI_ANDROID_EXPORT ViewAndroidObserver {
  9. public:
  10. // Notifies that view gets attached to window. Note that the notification
  11. // is not sent if view is already in attached state.
  12. virtual void OnAttachedToWindow() = 0;
  13. // Notifies that view gets detached from window. Note that the notification
  14. // is not sent if view is already in detached state.
  15. virtual void OnDetachedFromWindow() = 0;
  16. // Notifies the view has been destroyed.
  17. virtual void OnViewAndroidDestroyed() {}
  18. protected:
  19. virtual ~ViewAndroidObserver() {}
  20. };
  21. } // namespace ui
  22. #endif // UI_ANDROID_VIEW_ANDROID_OBSERVER_H_