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

Unified Diff: ash/root_window_controller.cc

Issue 14188054: Restore focus/activation after the root window has been completely deleted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/display_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 165a61df60657e1205b47bebbcf70b96a4e20c27..991f1eb2127d6ced2657b9058acbffc9d6083d42 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -38,15 +38,11 @@
#include "ash/wm/workspace_controller.h"
#include "base/command_line.h"
#include "base/time.h"
-#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/aura_constants.h"
-#include "ui/aura/client/capture_client.h"
-#include "ui/aura/client/focus_client.h"
#include "ui/aura/client/tooltip_client.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
-#include "ui/aura/window_tracker.h"
#include "ui/base/models/menu_model.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
@@ -406,38 +402,10 @@ void RootWindowController::CloseChildWindows() {
}
void RootWindowController::MoveWindowsTo(aura::RootWindow* dst) {
- aura::Window* focused = aura::client::GetFocusClient(dst)->GetFocusedWindow();
- aura::WindowTracker tracker;
- if (focused)
- tracker.Add(focused);
- aura::client::ActivationClient* activation_client =
- aura::client::GetActivationClient(dst);
- aura::Window* active = activation_client->GetActiveWindow();
- if (active && focused != active)
- tracker.Add(active);
- // Deactivate the window to close menu / bubble windows.
- activation_client->DeactivateWindow(active);
- // Release capture if any.
- aura::client::GetCaptureClient(root_window_.get())->
- SetCapture(NULL);
- // Clear the focused window if any. This is necessary because a
- // window may be deleted when losing focus (fullscreen flash for
- // example). If the focused window is still alive after move, it'll
- // be re-focused below.
- aura::client::GetFocusClient(dst)->FocusWindow(NULL);
-
// Forget the shelf early so that shelf don't update itself using wrong
// display info.
workspace_controller_->SetShelf(NULL);
-
ReparentAllWindows(root_window_.get(), dst);
-
- // Restore focused or active window if it's still alive.
- if (focused && tracker.Contains(focused) && dst->Contains(focused)) {
- aura::client::GetFocusClient(dst)->FocusWindow(focused);
- } else if (active && tracker.Contains(active) && dst->Contains(active)) {
- activation_client->ActivateWindow(active);
- }
}
void RootWindowController::SetTouchObserverHUD(TouchObserverHUD* hud) {
« no previous file with comments | « ash/display/display_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698