| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/shell/browser/shell_platform_data_aura.h" | 5 #include "content/shell/browser/shell_platform_data_aura.h" |
| 6 | 6 |
| 7 #include "content/shell/browser/shell.h" | 7 #include "content/shell/browser/shell.h" |
| 8 #include "ui/aura/client/aura_constants.h" | 8 #include "ui/aura/client/aura_constants.h" |
| 9 #include "ui/aura/client/default_activation_client.h" |
| 9 #include "ui/aura/client/default_capture_client.h" | 10 #include "ui/aura/client/default_capture_client.h" |
| 10 #include "ui/aura/env.h" | 11 #include "ui/aura/env.h" |
| 11 #include "ui/aura/layout_manager.h" | 12 #include "ui/aura/layout_manager.h" |
| 12 #include "ui/aura/test/test_focus_client.h" | 13 #include "ui/aura/test/test_focus_client.h" |
| 13 #include "ui/aura/test/test_window_tree_client.h" | 14 #include "ui/aura/test/test_window_tree_client.h" |
| 14 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 15 #include "ui/aura/window_event_dispatcher.h" | 16 #include "ui/aura/window_event_dispatcher.h" |
| 16 #include "ui/base/ime/input_method.h" | 17 #include "ui/base/ime/input_method.h" |
| 17 #include "ui/base/ime/input_method_delegate.h" | 18 #include "ui/base/ime/input_method_delegate.h" |
| 18 #include "ui/base/ime/input_method_factory.h" | 19 #include "ui/base/ime/input_method_factory.h" |
| 19 #include "ui/gfx/screen.h" | 20 #include "ui/gfx/screen.h" |
| 20 #include "ui/wm/core/default_activation_client.h" | |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 class FillLayout : public aura::LayoutManager { | 26 class FillLayout : public aura::LayoutManager { |
| 27 public: | 27 public: |
| 28 explicit FillLayout(aura::Window* root) | 28 explicit FillLayout(aura::Window* root) |
| 29 : root_(root) { | 29 : root_(root) { |
| 30 } | 30 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 ShellPlatformDataAura::ShellPlatformDataAura(const gfx::Size& initial_size) { | 115 ShellPlatformDataAura::ShellPlatformDataAura(const gfx::Size& initial_size) { |
| 116 CHECK(aura::Env::GetInstance()); | 116 CHECK(aura::Env::GetInstance()); |
| 117 host_.reset(aura::WindowTreeHost::Create(gfx::Rect(initial_size))); | 117 host_.reset(aura::WindowTreeHost::Create(gfx::Rect(initial_size))); |
| 118 host_->InitHost(); | 118 host_->InitHost(); |
| 119 host_->window()->SetLayoutManager(new FillLayout(host_->window())); | 119 host_->window()->SetLayoutManager(new FillLayout(host_->window())); |
| 120 | 120 |
| 121 focus_client_.reset(new aura::test::TestFocusClient()); | 121 focus_client_.reset(new aura::test::TestFocusClient()); |
| 122 aura::client::SetFocusClient(host_->window(), focus_client_.get()); | 122 aura::client::SetFocusClient(host_->window(), focus_client_.get()); |
| 123 | 123 |
| 124 new wm::DefaultActivationClient(host_->window()); | 124 activation_client_.reset( |
| 125 new aura::client::DefaultActivationClient(host_->window())); |
| 125 capture_client_.reset( | 126 capture_client_.reset( |
| 126 new aura::client::DefaultCaptureClient(host_->window())); | 127 new aura::client::DefaultCaptureClient(host_->window())); |
| 127 window_tree_client_.reset( | 128 window_tree_client_.reset( |
| 128 new aura::test::TestWindowTreeClient(host_->window())); | 129 new aura::test::TestWindowTreeClient(host_->window())); |
| 129 ime_filter_.reset(new MinimalInputEventFilter(host_.get())); | 130 ime_filter_.reset(new MinimalInputEventFilter(host_.get())); |
| 130 } | 131 } |
| 131 | 132 |
| 132 ShellPlatformDataAura::~ShellPlatformDataAura() { | 133 ShellPlatformDataAura::~ShellPlatformDataAura() { |
| 133 } | 134 } |
| 134 | 135 |
| 135 void ShellPlatformDataAura::ShowWindow() { | 136 void ShellPlatformDataAura::ShowWindow() { |
| 136 host_->Show(); | 137 host_->Show(); |
| 137 } | 138 } |
| 138 | 139 |
| 139 void ShellPlatformDataAura::ResizeWindow(const gfx::Size& size) { | 140 void ShellPlatformDataAura::ResizeWindow(const gfx::Size& size) { |
| 140 host_->SetBounds(gfx::Rect(size)); | 141 host_->SetBounds(gfx::Rect(size)); |
| 141 } | 142 } |
| 142 | 143 |
| 143 } // namespace content | 144 } // namespace content |
| OLD | NEW |