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

Unified Diff: ui/aura_shell/shell.cc

Issue 8576005: IME (input method editor) support for Aura, part 3 of 3: Use ui::InputMethod in ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes Created 9 years 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: ui/aura_shell/shell.cc
diff --git a/ui/aura_shell/shell.cc b/ui/aura_shell/shell.cc
index e2cb991a987ddadd41befc99011031b2b76227c0..b3457ca2bab6500e9092b9abb74e42d094ab15c9 100644
--- a/ui/aura_shell/shell.cc
+++ b/ui/aura_shell/shell.cc
@@ -11,20 +11,21 @@
#include "ui/aura/aura_switches.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/drag_drop_client.h"
-#include "ui/aura/root_window.h"
#include "ui/aura/layout_manager.h"
+#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/aura/window_types.h"
#include "ui/aura_shell/activation_controller.h"
#include "ui/aura_shell/app_list.h"
#include "ui/aura_shell/default_container_event_filter.h"
#include "ui/aura_shell/default_container_layout_manager.h"
-#include "ui/aura_shell/root_window_event_filter.h"
-#include "ui/aura_shell/root_window_layout_manager.h"
#include "ui/aura_shell/drag_drop_controller.h"
+#include "ui/aura_shell/input_method_event_filter.h"
#include "ui/aura_shell/laptop_mode_layout_manager.h"
#include "ui/aura_shell/launcher/launcher.h"
#include "ui/aura_shell/modal_container_layout_manager.h"
+#include "ui/aura_shell/root_window_event_filter.h"
+#include "ui/aura_shell/root_window_layout_manager.h"
#include "ui/aura_shell/shadow_controller.h"
#include "ui/aura_shell/shelf_layout_manager.h"
#include "ui/aura_shell/shell_accelerator_controller.h"
@@ -127,6 +128,7 @@ Shell::Shell(ShellDelegate* delegate)
}
Shell::~Shell() {
+ RemoveRootWindowEventFilter(input_method_filter_.get());
RemoveRootWindowEventFilter(accelerator_filter_.get());
// ShellTooltipManager needs a valid shell instance. We delete it before
@@ -205,6 +207,12 @@ void Shell::Init() {
// Force a layout.
root_window->layout_manager()->OnWindowResized();
+ // Initialize InputMethodEventFilter. The filter must be added first since it
+ // has the highest priority.
+ DCHECK(!GetNumRootWindowEventFilters());
+ input_method_filter_.reset(new internal::InputMethodEventFilter);
+ AddRootWindowEventFilter(input_method_filter_.get());
+
// Initialize ShellAcceleratorFilter
accelerator_filter_.reset(new internal::ShellAcceleratorFilter);
AddRootWindowEventFilter(accelerator_filter_.get());
@@ -293,6 +301,11 @@ void Shell::RemoveRootWindowEventFilter(aura::EventFilter* filter) {
aura::RootWindow::GetInstance()->event_filter())->RemoveFilter(filter);
}
+size_t Shell::GetNumRootWindowEventFilters() const {
+ return static_cast<internal::RootWindowEventFilter*>(
+ aura::RootWindow::GetInstance()->event_filter())->GetNumFilters();
+}
+
void Shell::ToggleOverview() {
if (workspace_controller_.get())
workspace_controller_->ToggleOverview();

Powered by Google App Engine
This is Rietveld 408576698