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

Side by Side Diff: mojo/services/window_manager/basic_focus_rules.h

Issue 737913002: Dispatch key events to the currently focused window. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Redo FocusController storage so that it is a local property on a view. Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_SERIVCES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_ 5 #ifndef MOJO_SERIVCES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_
6 #define MOJO_SERIVCES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_ 6 #define MOJO_SERIVCES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_
7 7
8 #include "mojo/services/window_manager/focus_rules.h" 8 #include "mojo/services/window_manager/focus_rules.h"
9 9
10 namespace mojo { 10 namespace mojo {
11 11
12 class WindowManagerApp;
13 class View; 12 class View;
14 13
15 // The focusing rules used inside a window manager. 14 // The focusing rules used inside a window manager.
16 // 15 //
17 // This is intended to be a user supplyable, subclassable component passed to 16 // This is intended to be a user supplyable, subclassable component passed to
18 // WindowManagerApp, allowing for the creation of other window managers. 17 // WindowManagerApp, allowing for the creation of other window managers.
19 // 18 //
20 // TODO(erg): This was a straight move of the minimal focus rules from when 19 // TODO(erg): This was a straight move of the minimal focus rules from when
21 // WindowManagerApp directly used the wm::FocusController. This implementation 20 // WindowManagerApp directly used the wm::FocusController. This implementation
22 // is very incomplete. crbug.com/431047 21 // is very incomplete. crbug.com/431047
23 class BasicFocusRules : public FocusRules { 22 class BasicFocusRules : public FocusRules {
24 public: 23 public:
25 BasicFocusRules(mojo::WindowManagerApp* window_manager_app, 24 BasicFocusRules(mojo::View* window_container);
26 mojo::View* window_container);
27 ~BasicFocusRules() override; 25 ~BasicFocusRules() override;
28 26
29 protected: 27 protected:
30 // Overridden from mojo::FocusRules: 28 // Overridden from mojo::FocusRules:
31 bool IsToplevelView(mojo::View* view) const override; 29 bool IsToplevelView(mojo::View* view) const override;
32 bool CanActivateView(mojo::View* view) const override; 30 bool CanActivateView(mojo::View* view) const override;
33 bool CanFocusView(mojo::View* view) const override; 31 bool CanFocusView(mojo::View* view) const override;
34 mojo::View* GetToplevelView(mojo::View* view) const override; 32 mojo::View* GetToplevelView(mojo::View* view) const override;
35 mojo::View* GetActivatableView(mojo::View* view) const override; 33 mojo::View* GetActivatableView(mojo::View* view) const override;
36 mojo::View* GetFocusableView(mojo::View* view) const override; 34 mojo::View* GetFocusableView(mojo::View* view) const override;
37 mojo::View* GetNextActivatableView(mojo::View* activatable) const override; 35 mojo::View* GetNextActivatableView(mojo::View* activatable) const override;
38 36
39 private: 37 private:
40 mojo::View* window_container_; 38 mojo::View* window_container_;
41 mojo::WindowManagerApp* window_manager_app_;
42 39
43 DISALLOW_COPY_AND_ASSIGN(BasicFocusRules); 40 DISALLOW_COPY_AND_ASSIGN(BasicFocusRules);
44 }; 41 };
45 42
46 } // namespace mojo 43 } // namespace mojo
47 44
48 #endif // MOJO_SERIVCES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_ 45 #endif // MOJO_SERIVCES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_
OLDNEW
« no previous file with comments | « mojo/services/public/cpp/view_manager/view.h ('k') | mojo/services/window_manager/basic_focus_rules.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698