Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Unified Diff: ui/aura/focus_manager.h

Issue 11299219: Rework FocusManager as FocusClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/focus_change_observer.h ('k') | ui/aura/focus_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/focus_manager.h
===================================================================
--- ui/aura/focus_manager.h (revision 169818)
+++ ui/aura/focus_manager.h (working copy)
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/observer_list.h"
#include "ui/aura/aura_export.h"
+#include "ui/aura/client/focus_client.h"
namespace ui {
class Event;
@@ -15,36 +16,26 @@
namespace aura {
-class FocusChangeObserver;
class Window;
// An interface implemented by the Desktop to expose the focused window and
// allow for it to be changed.
-class AURA_EXPORT FocusManager {
+class AURA_EXPORT FocusManager : public client::FocusClient {
public:
FocusManager();
- ~FocusManager();
+ virtual ~FocusManager();
- void AddObserver(FocusChangeObserver* observer);
- void RemoveObserver(FocusChangeObserver* observer);
+ private:
+ // Overridden from client::FocusClient:
+ virtual void AddObserver(client::FocusChangeObserver* observer) OVERRIDE;
+ virtual void RemoveObserver(client::FocusChangeObserver* observer) OVERRIDE;
+ virtual void FocusWindow(Window* window, const ui::Event* event) OVERRIDE;
+ virtual Window* GetFocusedWindow() OVERRIDE;
- // Sets the currently focused window. Before the currently focused window is
- // changed, the previous focused window's delegate is sent a blur
- // notification, and after it is changed the new focused window is sent a
- // focused notification. Nothing happens if |window| and GetFocusedWindow()
- // match.
- void SetFocusedWindow(Window* window, const ui::Event* event);
-
- // Returns the currently focused window or NULL if there is none.
- Window* GetFocusedWindow();
-
- // Returns true if |window| is the focused window.
- bool IsFocusedWindow(const Window* window) const;
-
protected:
aura::Window* focused_window_;
- ObserverList<FocusChangeObserver> observers_;
+ ObserverList<client::FocusChangeObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(FocusManager);
};
« no previous file with comments | « ui/aura/focus_change_observer.h ('k') | ui/aura/focus_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698