OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/shell/minimal_shell.h" | 5 #include "ui/shell/minimal_shell.h" |
6 | 6 |
7 #include "ui/aura/client/default_activation_client.h" | 7 #include "ui/aura/client/default_activation_client.h" |
8 #include "ui/aura/client/default_capture_client.h" | 8 #include "ui/aura/client/default_capture_client.h" |
9 #include "ui/aura/env.h" | 9 #include "ui/aura/env.h" |
10 #include "ui/aura/root_window.h" | 10 #include "ui/aura/root_window.h" |
11 #include "ui/aura/test/test_focus_client.h" | 11 #include "ui/aura/test/test_focus_client.h" |
12 #include "ui/views/corewm/compound_event_filter.h" | 12 #include "ui/views/corewm/compound_event_filter.h" |
13 #include "ui/views/corewm/input_method_event_filter.h" | 13 #include "ui/views/corewm/input_method_event_filter.h" |
14 | 14 |
15 namespace shell { | 15 namespace shell { |
16 | 16 |
17 MinimalShell::MinimalShell(const gfx::Size& default_window_size) { | 17 MinimalShell::MinimalShell(const gfx::Size& default_window_size) { |
18 aura::Env::CreateInstance(); | 18 aura::Env::CreateInstance(); |
19 root_window_.reset(new aura::RootWindow( | 19 root_window_.reset(new aura::RootWindow( |
20 aura::RootWindow::CreateParams( | 20 aura::RootWindow::CreateParams( |
21 gfx::Rect(default_window_size)))); | 21 gfx::Rect(default_window_size)))); |
22 root_window_->Init(); | 22 root_window_->Init(); |
23 aura::client::SetStackingClient(root_window_.get(), this); | 23 aura::client::SetWindowTreeClient(root_window_.get(), this); |
24 | 24 |
25 focus_client_.reset(new aura::test::TestFocusClient); | 25 focus_client_.reset(new aura::test::TestFocusClient); |
26 aura::client::SetFocusClient(root_window_.get(), focus_client_.get()); | 26 aura::client::SetFocusClient(root_window_.get(), focus_client_.get()); |
27 | 27 |
28 root_window_event_filter_ = new views::corewm::CompoundEventFilter; | 28 root_window_event_filter_ = new views::corewm::CompoundEventFilter; |
29 // Pass ownership of the filter to the root_window. | 29 // Pass ownership of the filter to the root_window. |
30 root_window_->SetEventFilter(root_window_event_filter_); | 30 root_window_->SetEventFilter(root_window_event_filter_); |
31 | 31 |
32 input_method_filter_.reset(new views::corewm::InputMethodEventFilter( | 32 input_method_filter_.reset(new views::corewm::InputMethodEventFilter( |
33 root_window_->GetAcceleratedWidget())); | 33 root_window_->GetAcceleratedWidget())); |
(...skipping 13 matching lines...) Expand all Loading... |
47 } | 47 } |
48 | 48 |
49 aura::Window* MinimalShell::GetDefaultParent( | 49 aura::Window* MinimalShell::GetDefaultParent( |
50 aura::Window* context, | 50 aura::Window* context, |
51 aura::Window* window, | 51 aura::Window* window, |
52 const gfx::Rect& bounds) { | 52 const gfx::Rect& bounds) { |
53 return root_window_.get(); | 53 return root_window_.get(); |
54 } | 54 } |
55 | 55 |
56 } // namespace shell | 56 } // namespace shell |
OLD | NEW |