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 "extensions/browser/app_window/app_window.h" | 12 #include "extensions/browser/app_window/app_window.h" |
13 #include "extensions/browser/app_window/native_app_window.h" | 13 #include "extensions/browser/app_window/native_app_window.h" |
14 #include "extensions/shell/browser/shell_app_delegate.h" | 14 #include "extensions/shell/browser/shell_app_delegate.h" |
15 #include "extensions/shell/browser/shell_app_window_client.h" | 15 #include "extensions/shell/browser/shell_app_window_client.h" |
16 #include "extensions/shell/browser/shell_screen.h" | 16 #include "extensions/shell/browser/shell_screen.h" |
17 #include "extensions/shell/common/switches.h" | 17 #include "extensions/shell/common/switches.h" |
18 #include "ui/aura/client/cursor_client.h" | 18 #include "ui/aura/client/cursor_client.h" |
19 #include "ui/aura/client/default_capture_client.h" | 19 #include "ui/aura/client/default_capture_client.h" |
20 #include "ui/aura/layout_manager.h" | 20 #include "ui/aura/layout_manager.h" |
21 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
22 #include "ui/aura/window_event_dispatcher.h" | 22 #include "ui/aura/window_event_dispatcher.h" |
23 #include "ui/aura/window_tree_host.h" | 23 #include "ui/aura/window_tree_host.h" |
24 #include "ui/base/cursor/cursor.h" | 24 #include "ui/base/cursor/cursor.h" |
25 #include "ui/base/cursor/image_cursors.h" | 25 #include "ui/base/cursor/image_cursors.h" |
26 #include "ui/base/ime/input_method_initializer.h" | 26 #include "ui/base/ime/input_method_initializer.h" |
| 27 #include "ui/base/user_activity/user_activity_detector.h" |
27 #include "ui/gfx/geometry/size.h" | 28 #include "ui/gfx/geometry/size.h" |
28 #include "ui/gfx/native_widget_types.h" | 29 #include "ui/gfx/native_widget_types.h" |
29 #include "ui/gfx/screen.h" | 30 #include "ui/gfx/screen.h" |
30 #include "ui/wm/core/base_focus_rules.h" | 31 #include "ui/wm/core/base_focus_rules.h" |
31 #include "ui/wm/core/compound_event_filter.h" | 32 #include "ui/wm/core/compound_event_filter.h" |
32 #include "ui/wm/core/cursor_manager.h" | 33 #include "ui/wm/core/cursor_manager.h" |
33 #include "ui/wm/core/focus_controller.h" | 34 #include "ui/wm/core/focus_controller.h" |
34 #include "ui/wm/core/input_method_event_filter.h" | 35 #include "ui/wm/core/input_method_event_filter.h" |
35 #include "ui/wm/core/native_cursor_manager.h" | 36 #include "ui/wm/core/native_cursor_manager.h" |
36 #include "ui/wm/core/native_cursor_manager_delegate.h" | 37 #include "ui/wm/core/native_cursor_manager_delegate.h" |
37 #include "ui/wm/core/user_activity_detector.h" | |
38 | 38 |
39 #if defined(OS_CHROMEOS) | 39 #if defined(OS_CHROMEOS) |
40 #include "chromeos/dbus/dbus_thread_manager.h" | 40 #include "chromeos/dbus/dbus_thread_manager.h" |
41 #include "ui/chromeos/user_activity_power_manager_notifier.h" | 41 #include "ui/chromeos/user_activity_power_manager_notifier.h" |
42 #include "ui/display/types/display_mode.h" | 42 #include "ui/display/types/display_mode.h" |
43 #include "ui/display/types/display_snapshot.h" | 43 #include "ui/display/types/display_snapshot.h" |
44 #endif | 44 #endif |
45 | 45 |
46 namespace extensions { | 46 namespace extensions { |
47 namespace { | 47 namespace { |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 host_->window()->SetLayoutManager(new FillLayout); | 271 host_->window()->SetLayoutManager(new FillLayout); |
272 | 272 |
273 cursor_manager_.reset( | 273 cursor_manager_.reset( |
274 new wm::CursorManager(scoped_ptr<wm::NativeCursorManager>( | 274 new wm::CursorManager(scoped_ptr<wm::NativeCursorManager>( |
275 new ShellNativeCursorManager(host_.get())))); | 275 new ShellNativeCursorManager(host_.get())))); |
276 cursor_manager_->SetDisplay( | 276 cursor_manager_->SetDisplay( |
277 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay()); | 277 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay()); |
278 cursor_manager_->SetCursor(ui::kCursorPointer); | 278 cursor_manager_->SetCursor(ui::kCursorPointer); |
279 aura::client::SetCursorClient(host_->window(), cursor_manager_.get()); | 279 aura::client::SetCursorClient(host_->window(), cursor_manager_.get()); |
280 | 280 |
281 user_activity_detector_.reset(new wm::UserActivityDetector); | 281 user_activity_detector_.reset(new ui::UserActivityDetector); |
282 host_->event_processor()->GetRootTarget()->AddPreTargetHandler( | 282 host_->event_processor()->GetRootTarget()->AddPreTargetHandler( |
283 user_activity_detector_.get()); | 283 user_activity_detector_.get()); |
284 #if defined(OS_CHROMEOS) | 284 #if defined(OS_CHROMEOS) |
285 user_activity_notifier_.reset( | 285 user_activity_notifier_.reset( |
286 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); | 286 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); |
287 #endif | 287 #endif |
288 } | 288 } |
289 | 289 |
290 void ShellDesktopControllerAura::CreateRootWindow() { | 290 void ShellDesktopControllerAura::CreateRootWindow() { |
291 // Set up basic pieces of ui::wm. | 291 // Set up basic pieces of ui::wm. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 if (displays.empty()) | 354 if (displays.empty()) |
355 return gfx::Size(); | 355 return gfx::Size(); |
356 const ui::DisplayMode* mode = displays[0].display->current_mode(); | 356 const ui::DisplayMode* mode = displays[0].display->current_mode(); |
357 return mode ? mode->size() : gfx::Size(); | 357 return mode ? mode->size() : gfx::Size(); |
358 #else | 358 #else |
359 return gfx::Size(); | 359 return gfx::Size(); |
360 #endif | 360 #endif |
361 } | 361 } |
362 | 362 |
363 } // namespace extensions | 363 } // namespace extensions |
OLD | NEW |