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

Unified Diff: services/view_manager/focus_controller.cc

Issue 1530333005: Delete the ViewManager and WindowManager services. (Closed) Base URL: git@github.com:domokit/mojo.git@cl-2c
Patch Set: rebase Created 5 years 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 | « services/view_manager/focus_controller.h ('k') | services/view_manager/focus_controller_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/view_manager/focus_controller.cc
diff --git a/services/view_manager/focus_controller.cc b/services/view_manager/focus_controller.cc
deleted file mode 100644
index 65ee0feaf8c6b00095329fb3e96a0fd389688afd..0000000000000000000000000000000000000000
--- a/services/view_manager/focus_controller.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "services/view_manager/focus_controller.h"
-
-#include "services/view_manager/focus_controller_delegate.h"
-#include "services/view_manager/server_view.h"
-#include "services/view_manager/server_view_drawn_tracker.h"
-
-namespace view_manager {
-
-FocusController::FocusController(FocusControllerDelegate* delegate,
- ServerView* root)
- : delegate_(delegate), root_(root) {
-}
-
-FocusController::~FocusController() {
-}
-
-void FocusController::SetFocusedView(ServerView* view) {
- if (GetFocusedView() == view)
- return;
-
- SetFocusedViewImpl(view, CHANGE_SOURCE_EXPLICIT);
-}
-
-ServerView* FocusController::GetFocusedView() {
- return drawn_tracker_ ? drawn_tracker_->view() : nullptr;
-}
-
-void FocusController::SetFocusedViewImpl(ServerView* view,
- ChangeSource change_source) {
- ServerView* old = GetFocusedView();
-
- DCHECK(!view || view->IsDrawn(root_));
-
- if (view)
- drawn_tracker_.reset(new ServerViewDrawnTracker(root_, view, this));
- else
- drawn_tracker_.reset();
-
- if (change_source == CHANGE_SOURCE_DRAWN_STATE_CHANGED)
- delegate_->OnFocusChanged(old, view);
-}
-
-void FocusController::OnDrawnStateChanged(ServerView* ancestor,
- ServerView* view,
- bool is_drawn) {
- DCHECK(!is_drawn); // We only observe when drawn.
- SetFocusedViewImpl(ancestor, CHANGE_SOURCE_DRAWN_STATE_CHANGED);
-}
-
-} // namespace view_manager
« no previous file with comments | « services/view_manager/focus_controller.h ('k') | services/view_manager/focus_controller_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698