| 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 "extensions/shell/browser/shell_desktop_controller_aura.h" | 5 #include "extensions/shell/browser/shell_desktop_controller_aura.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/location.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/threading/thread_task_runner_handle.h" |
| 13 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 14 #include "extensions/browser/app_window/app_window.h" | 17 #include "extensions/browser/app_window/app_window.h" |
| 15 #include "extensions/browser/app_window/native_app_window.h" | 18 #include "extensions/browser/app_window/native_app_window.h" |
| 16 #include "extensions/shell/browser/shell_app_delegate.h" | 19 #include "extensions/shell/browser/shell_app_delegate.h" |
| 17 #include "extensions/shell/browser/shell_app_window_client.h" | 20 #include "extensions/shell/browser/shell_app_window_client.h" |
| 18 #include "extensions/shell/browser/shell_screen.h" | 21 #include "extensions/shell/browser/shell_screen.h" |
| 19 #include "extensions/shell/common/switches.h" | 22 #include "extensions/shell/common/switches.h" |
| 20 #include "ui/aura/client/cursor_client.h" | 23 #include "ui/aura/client/cursor_client.h" |
| 21 #include "ui/aura/client/default_capture_client.h" | 24 #include "ui/aura/client/default_capture_client.h" |
| 22 #include "ui/aura/layout_manager.h" | 25 #include "ui/aura/layout_manager.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 gfx::Size size = GetPrimaryDisplaySize(); | 260 gfx::Size size = GetPrimaryDisplaySize(); |
| 258 if (!size.IsEmpty()) | 261 if (!size.IsEmpty()) |
| 259 host_->UpdateRootWindowSize(size); | 262 host_->UpdateRootWindowSize(size); |
| 260 } | 263 } |
| 261 #endif | 264 #endif |
| 262 | 265 |
| 263 void ShellDesktopControllerAura::OnHostCloseRequested( | 266 void ShellDesktopControllerAura::OnHostCloseRequested( |
| 264 const aura::WindowTreeHost* host) { | 267 const aura::WindowTreeHost* host) { |
| 265 DCHECK_EQ(host_.get(), host); | 268 DCHECK_EQ(host_.get(), host); |
| 266 CloseAppWindows(); | 269 CloseAppWindows(); |
| 267 base::MessageLoop::current()->PostTask( | 270 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 268 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); | 271 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
| 269 } | 272 } |
| 270 | 273 |
| 271 void ShellDesktopControllerAura::InitWindowManager() { | 274 void ShellDesktopControllerAura::InitWindowManager() { |
| 272 wm::FocusController* focus_controller = | 275 wm::FocusController* focus_controller = |
| 273 new wm::FocusController(new AppsFocusRules()); | 276 new wm::FocusController(new AppsFocusRules()); |
| 274 aura::client::SetFocusClient(host_->window(), focus_controller); | 277 aura::client::SetFocusClient(host_->window(), focus_controller); |
| 275 host_->window()->AddPreTargetHandler(focus_controller); | 278 host_->window()->AddPreTargetHandler(focus_controller); |
| 276 aura::client::SetActivationClient(host_->window(), focus_controller); | 279 aura::client::SetActivationClient(host_->window(), focus_controller); |
| 277 focus_client_.reset(focus_controller); | 280 focus_client_.reset(focus_controller); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 if (displays.empty()) | 359 if (displays.empty()) |
| 357 return gfx::Size(); | 360 return gfx::Size(); |
| 358 const ui::DisplayMode* mode = displays[0]->current_mode(); | 361 const ui::DisplayMode* mode = displays[0]->current_mode(); |
| 359 return mode ? mode->size() : gfx::Size(); | 362 return mode ? mode->size() : gfx::Size(); |
| 360 #else | 363 #else |
| 361 return gfx::Size(); | 364 return gfx::Size(); |
| 362 #endif | 365 #endif |
| 363 } | 366 } |
| 364 | 367 |
| 365 } // namespace extensions | 368 } // namespace extensions |
| OLD | NEW |