OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/shell/minimal_ash.h" |
| 6 |
| 7 #include "ui/aura/client/default_capture_client.h" |
| 8 #include "ui/aura/focus_manager.h" |
| 9 #include "ui/aura/root_window.h" |
| 10 #include "ui/aura/test/test_activation_client.h" |
| 11 #include "ui/views/corewm/compound_event_filter.h" |
| 12 #include "ui/views/corewm/input_method_event_filter.h" |
| 13 |
| 14 namespace content { |
| 15 |
| 16 MinimalAsh::MinimalAsh() { |
| 17 root_window_.reset(new aura::RootWindow( |
| 18 aura::RootWindow::CreateParams(gfx::Rect(100, 100)))); |
| 19 root_window_->Init(); |
| 20 aura::client::SetStackingClient(root_window_.get(), this); |
| 21 |
| 22 focus_client_.reset(new aura::FocusManager); |
| 23 aura::client::SetFocusClient(root_window_.get(), focus_client_.get()); |
| 24 |
| 25 root_window_event_filter_ = new views::corewm::CompoundEventFilter; |
| 26 // Pass ownership of the filter to the root_window. |
| 27 root_window_->SetEventFilter(root_window_event_filter_); |
| 28 |
| 29 input_method_filter_.reset(new views::corewm::InputMethodEventFilter( |
| 30 root_window_->GetAcceleratedWidget())); |
| 31 input_method_filter_->SetInputMethodPropertyInRootWindow( |
| 32 root_window_.get()); |
| 33 root_window_event_filter_->AddHandler(input_method_filter_.get()); |
| 34 |
| 35 test_activation_client_.reset( |
| 36 new aura::test::TestActivationClient(root_window_.get())); |
| 37 |
| 38 capture_client_.reset( |
| 39 new aura::client::DefaultCaptureClient(root_window_.get())); |
| 40 } |
| 41 |
| 42 MinimalAsh::~MinimalAsh() { |
| 43 root_window_event_filter_->RemoveHandler(input_method_filter_.get()); |
| 44 } |
| 45 |
| 46 aura::Window* MinimalAsh::GetDefaultParent( |
| 47 aura::Window* context, |
| 48 aura::Window* window, |
| 49 const gfx::Rect& bounds) { |
| 50 return root_window_.get(); |
| 51 } |
| 52 |
| 53 } // namespace content |
OLD | NEW |