focus_change_observer.h 947 B

123456789101112131415161718192021222324252627282930313233
  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_FOCUS_CHANGE_OBSERVER_H_
  5. #define UI_AURA_CLIENT_FOCUS_CHANGE_OBSERVER_H_
  6. #include "ui/aura/aura_export.h"
  7. namespace aura {
  8. class Window;
  9. namespace client {
  10. // TODO(beng): this interface will be OBSOLETE by FocusChangeEvent.
  11. class AURA_EXPORT FocusChangeObserver {
  12. public:
  13. // Called when focus moves from |lost_focus| to |gained_focus|.
  14. virtual void OnWindowFocused(Window* gained_focus, Window* lost_focus) = 0;
  15. protected:
  16. virtual ~FocusChangeObserver() {}
  17. };
  18. AURA_EXPORT FocusChangeObserver* GetFocusChangeObserver(Window* window);
  19. AURA_EXPORT void SetFocusChangeObserver(
  20. Window* window,
  21. FocusChangeObserver* focus_change_observer);
  22. } // namespace client
  23. } // namespace aura
  24. #endif // UI_AURA_CLIENT_FOCUS_CHANGE_OBSERVER_H_