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

Unified Diff: ash/wm/window_util.cc

Issue 9702072: Second try for (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
Index: ash/wm/window_util.cc
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc
index accafd9c41af3c9bf18ab9263072e7345be9f232..d45c0612d2d1cb1fdde84e61a646ef6b2c62b136 100644
--- a/ash/wm/window_util.cc
+++ b/ash/wm/window_util.cc
@@ -22,17 +22,26 @@ DEFINE_WINDOW_PROPERTY_KEY(bool, kOpenWindowSplitKey, false);
namespace wm {
void ActivateWindow(aura::Window* window) {
- aura::client::GetActivationClient(Shell::GetRootWindow())->ActivateWindow(
+ DCHECK(window);
+ DCHECK(window->GetRootWindow());
+ aura::client::GetActivationClient(window->GetRootWindow())->ActivateWindow(
window);
}
void DeactivateWindow(aura::Window* window) {
- aura::client::GetActivationClient(Shell::GetRootWindow())->DeactivateWindow(
+ DCHECK(window);
+ DCHECK(window->GetRootWindow());
+ aura::client::GetActivationClient(window->GetRootWindow())->DeactivateWindow(
window);
}
bool IsActiveWindow(aura::Window* window) {
- return GetActiveWindow() == window;
+ DCHECK(window);
+ if (!window->GetRootWindow())
+ return false;
+
+ return aura::client::GetActivationClient(window->GetRootWindow())->
+ GetActiveWindow() == window;
}
aura::Window* GetActiveWindow() {
« no previous file with comments | « ash/wm/activation_controller_unittest.cc ('k') | chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698