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

Unified Diff: ash/wm/window_modality_controller.cc

Issue 11418224: Eliminates all ash dependencies from WindowModalityController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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/wm/window_modality_controller.h ('k') | ash/wm/window_modality_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_modality_controller.cc
===================================================================
--- ash/wm/window_modality_controller.cc (revision 170295)
+++ ash/wm/window_modality_controller.cc (working copy)
@@ -6,20 +6,22 @@
#include <algorithm>
-#include "ash/wm/window_properties.h"
-#include "ash/wm/window_util.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/capture_client.h"
#include "ui/aura/env.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
+#include "ui/aura/window_property.h"
#include "ui/base/events/event.h"
#include "ui/base/ui_base_types.h"
#include "ui/views/corewm/window_animations.h"
+#include "ui/views/corewm/window_util.h"
namespace ash {
-namespace wm {
+// Transient child's modal parent.
+extern const aura::WindowProperty<aura::Window*>* const kModalParentKey;
+DEFINE_WINDOW_PROPERTY_KEY(aura::Window*, kModalParentKey, NULL);
namespace {
@@ -40,7 +42,7 @@
}
aura::Window* GetModalParent(aura::Window* window) {
- return window->GetProperty(ash::internal::kModalParentKey);
+ return window->GetProperty(kModalParentKey);
}
bool IsModalTransientChild(aura::Window* transient, aura::Window* original) {
@@ -69,7 +71,7 @@
} // namespace
void SetModalParent(aura::Window* child, aura::Window* parent) {
- child->SetProperty(ash::internal::kModalParentKey, parent);
+ child->SetProperty(kModalParentKey, parent);
}
aura::Window* GetModalTransient(aura::Window* window) {
@@ -78,15 +80,13 @@
// We always want to check the for the transient child of the activatable
// window.
- aura::Window* activatable = wm::GetActivatableWindow(window);
+ aura::Window* activatable = views::corewm::GetActivatableWindow(window);
if (!activatable)
return NULL;
return GetModalTransientChild(activatable, window);
}
-} // namespace wm
-
namespace internal {
////////////////////////////////////////////////////////////////////////////////
@@ -107,8 +107,7 @@
ui::EventResult WindowModalityController::OnKeyEvent(ui::KeyEvent* event) {
aura::Window* target = static_cast<aura::Window*>(event->target());
- return wm::GetModalTransient(target) ? ui::ER_CONSUMED :
- ui::ER_UNHANDLED;
+ return GetModalTransient(target) ? ui::ER_CONSUMED : ui::ER_UNHANDLED;
}
ui::EventResult WindowModalityController::OnMouseEvent(ui::MouseEvent* event) {
@@ -148,7 +147,7 @@
bool WindowModalityController::ProcessLocatedEvent(aura::Window* target,
ui::LocatedEvent* event) {
- aura::Window* modal_transient_child = wm::GetModalTransient(target);
+ aura::Window* modal_transient_child = GetModalTransient(target);
if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED ||
event->type() == ui::ET_TOUCH_PRESSED)) {
views::corewm::AnimateWindow(modal_transient_child,
« no previous file with comments | « ash/wm/window_modality_controller.h ('k') | ash/wm/window_modality_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698