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

Unified Diff: ash/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: move to ash/ime/ 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
« no previous file with comments | « ash/shell.h ('k') | ash/wm/root_window_event_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 3e132d5884c661ea49b92e73210a00f1b5fc3b8b..25834a2f32f0d68b9f026481dffac0f601c2fa0e 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -11,6 +11,7 @@
#include "ash/app_list/app_list.h"
#include "ash/ash_switches.h"
#include "ash/drag_drop/drag_drop_controller.h"
+#include "ash/ime/input_method_event_filter.h"
#include "ash/launcher/launcher.h"
#include "ash/shell_delegate.h"
#include "ash/shell_factory.h"
@@ -33,8 +34,9 @@
#include "ash/wm/workspace_controller.h"
#include "base/bind.h"
#include "base/command_line.h"
-#include "ui/aura/root_window.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/aura/layout_manager.h"
+#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/gfx/compositor/layer.h"
#include "ui/gfx/compositor/layer_animator.h"
@@ -132,6 +134,7 @@ Shell::Shell(ShellDelegate* delegate)
}
Shell::~Shell() {
+ RemoveRootWindowEventFilter(input_method_filter_.get());
RemoveRootWindowEventFilter(accelerator_filter_.get());
// TooltipController needs a valid shell instance. We delete it before
@@ -217,6 +220,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(!GetRootWindowEventFilterCount());
+ input_method_filter_.reset(new internal::InputMethodEventFilter);
+ AddRootWindowEventFilter(input_method_filter_.get());
+
// Initialize AcceleratorFilter.
accelerator_filter_.reset(new internal::AcceleratorFilter);
AddRootWindowEventFilter(accelerator_filter_.get());
@@ -323,6 +332,11 @@ void Shell::RemoveRootWindowEventFilter(aura::EventFilter* filter) {
aura::RootWindow::GetInstance()->event_filter())->RemoveFilter(filter);
}
+size_t Shell::GetRootWindowEventFilterCount() const {
+ return static_cast<internal::RootWindowEventFilter*>(
+ aura::RootWindow::GetInstance()->event_filter())->GetFilterCount();
+}
+
void Shell::ToggleOverview() {
if (workspace_controller_.get())
workspace_controller_->ToggleOverview();
« no previous file with comments | « ash/shell.h ('k') | ash/wm/root_window_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698