summaryrefslogtreecommitdiff
path: root/chromium/ash/wm/capture_controller.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ash/wm/capture_controller.cc')
-rw-r--r--chromium/ash/wm/capture_controller.cc74
1 files changed, 0 insertions, 74 deletions
diff --git a/chromium/ash/wm/capture_controller.cc b/chromium/ash/wm/capture_controller.cc
deleted file mode 100644
index 4e17054374f..00000000000
--- a/chromium/ash/wm/capture_controller.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2012 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 "ash/wm/capture_controller.h"
-
-#include "ash/shell.h"
-#include "ui/aura/window.h"
-#include "ui/aura/root_window.h"
-
-namespace ash {
-namespace internal {
-
-////////////////////////////////////////////////////////////////////////////////
-// CaptureController, public:
-
-CaptureController::CaptureController()
- : capture_window_(NULL) {
-}
-
-CaptureController::~CaptureController() {
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// CaptureController, client::CaptureClient implementation:
-
-void CaptureController::SetCapture(aura::Window* new_capture_window) {
- if (capture_window_ == new_capture_window)
- return;
- // Make sure window has a root window.
- DCHECK(!new_capture_window || new_capture_window->GetRootWindow());
- DCHECK(!capture_window_ || capture_window_->GetRootWindow());
-
- aura::Window* old_capture_window = capture_window_;
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
-
- // If we're actually starting capture, then cancel any touches/gestures
- // that aren't already locked to the new window, and transfer any on the
- // old capture window to the new one. When capture is released we have no
- // distinction between the touches/gestures that were in the window all
- // along (and so shouldn't be canceled) and those that got moved, so
- // just leave them all where they are.
- if (new_capture_window) {
- for (Shell::RootWindowList::iterator iter = root_windows.begin();
- iter != root_windows.end(); ++iter) {
- aura::RootWindow* root_window = *iter;
- root_window->gesture_recognizer()->
- TransferEventsTo(old_capture_window, new_capture_window);
- }
- }
-
- capture_window_ = new_capture_window;
-
- for (Shell::RootWindowList::iterator iter = root_windows.begin();
- iter != root_windows.end(); ++iter) {
- aura::RootWindow* root_window = *iter;
- root_window->UpdateCapture(old_capture_window, new_capture_window);
- }
-
- return;
-}
-
-void CaptureController::ReleaseCapture(aura::Window* window) {
- if (capture_window_ != window)
- return;
- SetCapture(NULL);
-}
-
-aura::Window* CaptureController::GetCaptureWindow() {
- return capture_window_;
-}
-
-} // namespace internal
-} // namespace ash