visibility_client.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright (c) 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 UI_AURA_CLIENT_VISIBILITY_CLIENT_H_
  5. #define UI_AURA_CLIENT_VISIBILITY_CLIENT_H_
  6. #include "ui/aura/aura_export.h"
  7. namespace aura {
  8. class Window;
  9. namespace client {
  10. // An interface implemented by an object that manages the visibility of Windows'
  11. // layers as Window visibility changes.
  12. class AURA_EXPORT VisibilityClient {
  13. public:
  14. // Called when |window|'s visibility is changing to |visible|. The implementor
  15. // can perform additional actions before reflecting the visibility change on
  16. // the underlying layer.
  17. virtual void UpdateLayerVisibility(Window* window, bool visible) = 0;
  18. protected:
  19. virtual ~VisibilityClient() {}
  20. };
  21. // Sets the VisibilityClient on the Window.
  22. AURA_EXPORT void SetVisibilityClient(Window* window, VisibilityClient* client);
  23. // Gets the VisibilityClient for the window. This will crawl up |window|'s
  24. // hierarchy until it finds one.
  25. AURA_EXPORT VisibilityClient* GetVisibilityClient(Window* window);
  26. } // namespace clients
  27. } // namespace aura
  28. #endif // UI_AURA_CLIENT_VISIBILITY_CLIENT_H_