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

Side by Side Diff: services/view_manager/focus_controller.h

Issue 1531403003: Delete the ViewManager and WindowManager services. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-3
Patch Set: rebase Created 4 years, 11 months 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
« no previous file with comments | « services/view_manager/display_manager.cc ('k') | services/view_manager/focus_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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
5 #ifndef SERVICES_VIEW_MANAGER_FOCUS_CONTROLLER_H_
6 #define SERVICES_VIEW_MANAGER_FOCUS_CONTROLLER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "services/view_manager/server_view_drawn_tracker_observer.h"
10
11 namespace view_manager {
12
13 class FocusControllerDelegate;
14 class ServerView;
15 class ServerViewDrawnTracker;
16
17 // Tracks a focused view. Focus is moved to another view when the drawn state
18 // of the focused view changes and the delegate is notified.
19 class FocusController : public ServerViewDrawnTrackerObserver {
20 public:
21 FocusController(FocusControllerDelegate* delegate, ServerView* root);
22 ~FocusController() override;
23
24 // Sets the focused view. Does nothing if |view| is currently focused. This
25 // does not notify the delegate.
26 void SetFocusedView(ServerView* view);
27 ServerView* GetFocusedView();
28
29 private:
30 // Describes the source of the change.
31 enum ChangeSource {
32 CHANGE_SOURCE_EXPLICIT,
33 CHANGE_SOURCE_DRAWN_STATE_CHANGED,
34 };
35
36 // Implementation of SetFocusedView().
37 void SetFocusedViewImpl(ServerView* view, ChangeSource change_source);
38
39 // ServerViewDrawnTrackerObserver:
40 void OnDrawnStateChanged(ServerView* ancestor,
41 ServerView* view,
42 bool is_drawn) override;
43
44 FocusControllerDelegate* delegate_;
45 ServerView* root_;
46 scoped_ptr<ServerViewDrawnTracker> drawn_tracker_;
47
48 DISALLOW_COPY_AND_ASSIGN(FocusController);
49 };
50
51 } // namespace view_manager
52
53 #endif // SERVICES_VIEW_MANAGER_FOCUS_CONTROLLER_H_
OLDNEW
« no previous file with comments | « services/view_manager/display_manager.cc ('k') | services/view_manager/focus_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698