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

Unified Diff: ui/aura_shell/shell.cc

Issue 8574033: Beginnings of Window Modality support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | « ui/aura_shell/shell.h ('k') | ui/aura_shell/shell_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/shell.cc
===================================================================
--- ui/aura_shell/shell.cc (revision 110305)
+++ ui/aura_shell/shell.cc (working copy)
@@ -15,6 +15,7 @@
#include "ui/aura_shell/desktop_event_filter.h"
#include "ui/aura_shell/desktop_layout_manager.h"
#include "ui/aura_shell/launcher/launcher.h"
+#include "ui/aura_shell/modal_container_layout_manager.h"
#include "ui/aura_shell/shelf_layout_controller.h"
#include "ui/aura_shell/shell_delegate.h"
#include "ui/aura_shell/shell_factory.h"
@@ -60,6 +61,16 @@
launcher_container->set_id(internal::kShellWindowId_LauncherContainer);
containers->push_back(launcher_container);
+ aura::Window* modal_container = new aura::Window(NULL);
+ modal_container->SetEventFilter(
+ new ToplevelWindowEventFilter(modal_container));
+ modal_container->SetLayoutManager(
+ new internal::ModalContainerLayoutManager(modal_container));
+ modal_container->set_id(internal::kShellWindowId_ModalContainer);
+ containers->push_back(modal_container);
+
+ // TODO(beng): Figure out if we can make this use ModalityEventFilter instead
+ // of stops_event_propagation.
aura::Window* lock_container = new aura::Window(NULL);
lock_container->set_stops_event_propagation(true);
lock_container->set_id(internal::kShellWindowId_LockScreenContainer);
@@ -180,6 +191,16 @@
return aura::Desktop::GetInstance()->GetChildById(container_id);
}
+void Shell::AddDesktopEventFilter(aura::EventFilter* filter) {
+ static_cast<internal::DesktopEventFilter*>(
+ aura::Desktop::GetInstance()->event_filter())->AddFilter(filter);
+}
+
+void Shell::RemoveDesktopEventFilter(aura::EventFilter* filter) {
+ static_cast<internal::DesktopEventFilter*>(
+ aura::Desktop::GetInstance()->event_filter())->RemoveFilter(filter);
+}
+
void Shell::ToggleOverview() {
if (workspace_controller_.get())
workspace_controller_->ToggleOverview();
« no previous file with comments | « ui/aura_shell/shell.h ('k') | ui/aura_shell/shell_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698