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 "athena/env/public/athena_env.h" | 5 #include "athena/env/public/athena_env.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "athena/util/fill_layout_manager.h" | 9 #include "athena/util/fill_layout_manager.h" |
10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
11 #include "ui/aura/client/aura_constants.h" | 11 #include "ui/aura/client/aura_constants.h" |
12 #include "ui/aura/client/cursor_client.h" | 12 #include "ui/aura/client/cursor_client.h" |
13 #include "ui/aura/client/default_capture_client.h" | 13 #include "ui/aura/client/default_capture_client.h" |
14 #include "ui/aura/env.h" | 14 #include "ui/aura/env.h" |
15 #include "ui/aura/test/test_screen.h" | 15 #include "ui/aura/test/test_screen.h" |
16 #include "ui/aura/window_event_dispatcher.h" | 16 #include "ui/aura/window_event_dispatcher.h" |
17 #include "ui/aura/window_tree_host.h" | 17 #include "ui/aura/window_tree_host.h" |
18 #include "ui/aura/window_tree_host_observer.h" | 18 #include "ui/aura/window_tree_host_observer.h" |
19 #include "ui/base/cursor/cursor.h" | 19 #include "ui/base/cursor/cursor.h" |
20 #include "ui/base/cursor/image_cursors.h" | 20 #include "ui/base/cursor/image_cursors.h" |
| 21 #include "ui/base/user_activity/user_activity_detector.h" |
21 #include "ui/chromeos/user_activity_power_manager_notifier.h" | 22 #include "ui/chromeos/user_activity_power_manager_notifier.h" |
22 #include "ui/display/chromeos/display_configurator.h" | 23 #include "ui/display/chromeos/display_configurator.h" |
23 #include "ui/display/types/display_mode.h" | 24 #include "ui/display/types/display_mode.h" |
24 #include "ui/display/types/display_snapshot.h" | 25 #include "ui/display/types/display_snapshot.h" |
25 #include "ui/events/devices/device_data_manager.h" | 26 #include "ui/events/devices/device_data_manager.h" |
26 #include "ui/events/devices/input_device_event_observer.h" | 27 #include "ui/events/devices/input_device_event_observer.h" |
27 #include "ui/events/devices/touchscreen_device.h" | 28 #include "ui/events/devices/touchscreen_device.h" |
28 #include "ui/gfx/screen.h" | 29 #include "ui/gfx/screen.h" |
29 #include "ui/wm/core/compound_event_filter.h" | 30 #include "ui/wm/core/compound_event_filter.h" |
30 #include "ui/wm/core/cursor_manager.h" | 31 #include "ui/wm/core/cursor_manager.h" |
31 #include "ui/wm/core/input_method_event_filter.h" | 32 #include "ui/wm/core/input_method_event_filter.h" |
32 #include "ui/wm/core/native_cursor_manager.h" | 33 #include "ui/wm/core/native_cursor_manager.h" |
33 #include "ui/wm/core/native_cursor_manager_delegate.h" | 34 #include "ui/wm/core/native_cursor_manager_delegate.h" |
34 #include "ui/wm/core/user_activity_detector.h" | |
35 | 35 |
36 namespace athena { | 36 namespace athena { |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 AthenaEnv* instance = nullptr; | 40 AthenaEnv* instance = nullptr; |
41 | 41 |
42 // Screen object used during shutdown. | 42 // Screen object used during shutdown. |
43 gfx::Screen* screen_for_shutdown = nullptr; | 43 gfx::Screen* screen_for_shutdown = nullptr; |
44 | 44 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 root_window->SetLayoutManager(new FillLayoutManager(root_window)); | 238 root_window->SetLayoutManager(new FillLayoutManager(root_window)); |
239 | 239 |
240 cursor_manager_.reset( | 240 cursor_manager_.reset( |
241 new wm::CursorManager(scoped_ptr<wm::NativeCursorManager>( | 241 new wm::CursorManager(scoped_ptr<wm::NativeCursorManager>( |
242 new AthenaNativeCursorManager(host_.get())))); | 242 new AthenaNativeCursorManager(host_.get())))); |
243 cursor_manager_->SetDisplay( | 243 cursor_manager_->SetDisplay( |
244 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay()); | 244 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay()); |
245 cursor_manager_->SetCursor(ui::kCursorPointer); | 245 cursor_manager_->SetCursor(ui::kCursorPointer); |
246 aura::client::SetCursorClient(host_->window(), cursor_manager_.get()); | 246 aura::client::SetCursorClient(host_->window(), cursor_manager_.get()); |
247 | 247 |
248 user_activity_detector_.reset(new wm::UserActivityDetector); | 248 user_activity_detector_.reset(new ui::UserActivityDetector); |
249 host_->event_processor()->GetRootTarget()->AddPreTargetHandler( | 249 host_->event_processor()->GetRootTarget()->AddPreTargetHandler( |
250 user_activity_detector_.get()); | 250 user_activity_detector_.get()); |
251 user_activity_notifier_.reset(new ui::UserActivityPowerManagerNotifier( | 251 user_activity_notifier_.reset(new ui::UserActivityPowerManagerNotifier( |
252 user_activity_detector_.get())); | 252 user_activity_detector_.get())); |
253 | 253 |
254 host_->AddObserver(this); | 254 host_->AddObserver(this); |
255 host_->Show(); | 255 host_->Show(); |
256 | 256 |
257 DCHECK(!instance); | 257 DCHECK(!instance); |
258 instance = this; | 258 instance = this; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 framebuffer_size)); | 388 framebuffer_size)); |
389 } | 389 } |
390 | 390 |
391 scoped_ptr<aura::TestScreen> screen_; | 391 scoped_ptr<aura::TestScreen> screen_; |
392 scoped_ptr<aura::WindowTreeHost> host_; | 392 scoped_ptr<aura::WindowTreeHost> host_; |
393 | 393 |
394 scoped_ptr<wm::InputMethodEventFilter> input_method_filter_; | 394 scoped_ptr<wm::InputMethodEventFilter> input_method_filter_; |
395 scoped_ptr<wm::CompoundEventFilter> root_window_event_filter_; | 395 scoped_ptr<wm::CompoundEventFilter> root_window_event_filter_; |
396 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; | 396 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; |
397 scoped_ptr<wm::CursorManager> cursor_manager_; | 397 scoped_ptr<wm::CursorManager> cursor_manager_; |
398 scoped_ptr<wm::UserActivityDetector> user_activity_detector_; | 398 scoped_ptr<ui::UserActivityDetector> user_activity_detector_; |
399 scoped_ptr<ui::DisplayConfigurator> display_configurator_; | 399 scoped_ptr<ui::DisplayConfigurator> display_configurator_; |
400 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_; | 400 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_; |
401 | 401 |
402 std::vector<base::Closure> terminating_callbacks_; | 402 std::vector<base::Closure> terminating_callbacks_; |
403 | 403 |
404 DISALLOW_COPY_AND_ASSIGN(AthenaEnvImpl); | 404 DISALLOW_COPY_AND_ASSIGN(AthenaEnvImpl); |
405 }; | 405 }; |
406 | 406 |
407 } // namespace | 407 } // namespace |
408 | 408 |
(...skipping 10 matching lines...) Expand all Loading... |
419 | 419 |
420 // static | 420 // static |
421 | 421 |
422 // static | 422 // static |
423 void AthenaEnv::Shutdown() { | 423 void AthenaEnv::Shutdown() { |
424 DCHECK(instance); | 424 DCHECK(instance); |
425 delete instance; | 425 delete instance; |
426 } | 426 } |
427 | 427 |
428 } // namespace athena | 428 } // namespace athena |
OLD | NEW |