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 "apps/shell/browser/shell_desktop_controller.h" | 5 #include "apps/shell/browser/shell_desktop_controller.h" |
6 | 6 |
7 #include "apps/shell/browser/shell_app_window.h" | 7 #include "apps/shell/browser/shell_app_window.h" |
8 #include "content/public/browser/context_factory.h" | 8 #include "content/public/browser/context_factory.h" |
9 #include "ui/aura/client/cursor_client.h" | 9 #include "ui/aura/client/cursor_client.h" |
10 #include "ui/aura/client/default_capture_client.h" | 10 #include "ui/aura/client/default_capture_client.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 host_->window()->AddPreTargetHandler(root_window_event_filter_.get()); | 246 host_->window()->AddPreTargetHandler(root_window_event_filter_.get()); |
247 InitWindowManager(); | 247 InitWindowManager(); |
248 | 248 |
249 host_->AddObserver(this); | 249 host_->AddObserver(this); |
250 | 250 |
251 // Ensure the X window gets mapped. | 251 // Ensure the X window gets mapped. |
252 host_->Show(); | 252 host_->Show(); |
253 } | 253 } |
254 | 254 |
255 void ShellDesktopController::InitWindowManager() { | 255 void ShellDesktopController::InitWindowManager() { |
256 focus_client_.reset(new wm::FocusController(new AppsFocusRules())); | 256 wm::FocusController* focus_controller = |
257 aura::client::SetFocusClient(host_->window(), focus_client_.get()); | 257 new wm::FocusController(new AppsFocusRules()); |
| 258 aura::client::SetFocusClient(host_->window(), focus_controller); |
| 259 host_->window()->AddPreTargetHandler(focus_controller); |
| 260 focus_client_.reset(focus_controller); |
258 | 261 |
259 input_method_filter_.reset( | 262 input_method_filter_.reset( |
260 new wm::InputMethodEventFilter(host_->GetAcceleratedWidget())); | 263 new wm::InputMethodEventFilter(host_->GetAcceleratedWidget())); |
261 input_method_filter_->SetInputMethodPropertyInRootWindow(host_->window()); | 264 input_method_filter_->SetInputMethodPropertyInRootWindow(host_->window()); |
262 root_window_event_filter_->AddHandler(input_method_filter_.get()); | 265 root_window_event_filter_->AddHandler(input_method_filter_.get()); |
263 | 266 |
264 new wm::DefaultActivationClient(host_->window()); | 267 new wm::DefaultActivationClient(host_->window()); |
265 | 268 |
266 capture_client_.reset( | 269 capture_client_.reset( |
267 new aura::client::DefaultCaptureClient(host_->window())); | 270 new aura::client::DefaultCaptureClient(host_->window())); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 if (displays.empty()) | 317 if (displays.empty()) |
315 return gfx::Size(); | 318 return gfx::Size(); |
316 const ui::DisplayMode* mode = displays[0].display->current_mode(); | 319 const ui::DisplayMode* mode = displays[0].display->current_mode(); |
317 return mode ? mode->size() : gfx::Size(); | 320 return mode ? mode->size() : gfx::Size(); |
318 #else | 321 #else |
319 return gfx::Size(); | 322 return gfx::Size(); |
320 #endif | 323 #endif |
321 } | 324 } |
322 | 325 |
323 } // namespace apps | 326 } // namespace apps |
OLD | NEW |