Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: ash/shell.cc

Issue 2474913004: Tablet-like power button behavior on Convertible/Tablet ChromeOS devices (Closed)
Patch Set: based on comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 #include "ash/common/system/chromeos/bluetooth/bluetooth_notification_controller .h" 119 #include "ash/common/system/chromeos/bluetooth/bluetooth_notification_controller .h"
120 #include "ash/common/system/chromeos/power/power_status.h" 120 #include "ash/common/system/chromeos/power/power_status.h"
121 #include "ash/display/display_change_observer_chromeos.h" 121 #include "ash/display/display_change_observer_chromeos.h"
122 #include "ash/display/display_color_manager_chromeos.h" 122 #include "ash/display/display_color_manager_chromeos.h"
123 #include "ash/display/display_error_observer_chromeos.h" 123 #include "ash/display/display_error_observer_chromeos.h"
124 #include "ash/display/projecting_observer_chromeos.h" 124 #include "ash/display/projecting_observer_chromeos.h"
125 #include "ash/display/resolution_notification_controller.h" 125 #include "ash/display/resolution_notification_controller.h"
126 #include "ash/display/screen_orientation_controller_chromeos.h" 126 #include "ash/display/screen_orientation_controller_chromeos.h"
127 #include "ash/sticky_keys/sticky_keys_controller.h" 127 #include "ash/sticky_keys/sticky_keys_controller.h"
128 #include "ash/system/chromeos/power/power_event_observer.h" 128 #include "ash/system/chromeos/power/power_event_observer.h"
129 #include "ash/system/chromeos/power/tablet_power_button_controller.h"
129 #include "ash/system/chromeos/power/video_activity_notifier.h" 130 #include "ash/system/chromeos/power/video_activity_notifier.h"
130 #include "ash/touch/touch_transformer_controller.h" 131 #include "ash/touch/touch_transformer_controller.h"
131 #include "ash/virtual_keyboard_controller.h" 132 #include "ash/virtual_keyboard_controller.h"
132 #include "base/bind_helpers.h" 133 #include "base/bind_helpers.h"
133 #include "base/sys_info.h" 134 #include "base/sys_info.h"
134 #include "chromeos/audio/audio_a11y_controller.h" 135 #include "chromeos/audio/audio_a11y_controller.h"
135 #include "chromeos/chromeos_switches.h" 136 #include "chromeos/chromeos_switches.h"
136 #include "chromeos/dbus/dbus_thread_manager.h" 137 #include "chromeos/dbus/dbus_thread_manager.h"
137 #include "ui/chromeos/user_activity_power_manager_notifier.h" 138 #include "ui/chromeos/user_activity_power_manager_notifier.h"
138 #include "ui/display/chromeos/display_configurator.h" 139 #include "ui/display/chromeos/display_configurator.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 508
508 // These need a valid Shell instance to clean up properly, so explicitly 509 // These need a valid Shell instance to clean up properly, so explicitly
509 // delete them before invalidating the instance. 510 // delete them before invalidating the instance.
510 // Alphabetical. TODO(oshima): sort. 511 // Alphabetical. TODO(oshima): sort.
511 magnification_controller_.reset(); 512 magnification_controller_.reset();
512 tooltip_controller_.reset(); 513 tooltip_controller_.reset();
513 event_client_.reset(); 514 event_client_.reset();
514 toplevel_window_event_handler_.reset(); 515 toplevel_window_event_handler_.reset();
515 visibility_controller_.reset(); 516 visibility_controller_.reset();
516 517
518 #if defined(OS_CHROMEOS)
519 tablet_power_button_controller_.reset();
520 #endif
517 power_button_controller_.reset(); 521 power_button_controller_.reset();
518 lock_state_controller_.reset(); 522 lock_state_controller_.reset();
519 523
520 screen_pinning_controller_.reset(); 524 screen_pinning_controller_.reset();
521 525
522 #if defined(OS_CHROMEOS) 526 #if defined(OS_CHROMEOS)
523 resolution_notification_controller_.reset(); 527 resolution_notification_controller_.reset();
524 #endif 528 #endif
525 screenshot_controller_.reset(); 529 screenshot_controller_.reset();
526 mouse_cursor_filter_.reset(); 530 mouse_cursor_filter_.reset();
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 820
817 #if defined(OS_CHROMEOS) 821 #if defined(OS_CHROMEOS)
818 power_event_observer_.reset(new PowerEventObserver()); 822 power_event_observer_.reset(new PowerEventObserver());
819 user_activity_notifier_.reset( 823 user_activity_notifier_.reset(
820 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); 824 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get()));
821 video_activity_notifier_.reset( 825 video_activity_notifier_.reset(
822 new VideoActivityNotifier(video_detector_.get())); 826 new VideoActivityNotifier(video_detector_.get()));
823 bluetooth_notification_controller_.reset(new BluetoothNotificationController); 827 bluetooth_notification_controller_.reset(new BluetoothNotificationController);
824 screen_orientation_controller_.reset(new ScreenOrientationController()); 828 screen_orientation_controller_.reset(new ScreenOrientationController());
825 screen_layout_observer_.reset(new ScreenLayoutObserver()); 829 screen_layout_observer_.reset(new ScreenLayoutObserver());
830 tablet_power_button_controller_.reset(
831 new TabletPowerButtonController(lock_state_controller_.get()));
826 #endif 832 #endif
827 // The compositor thread and main message loop have to be running in 833 // The compositor thread and main message loop have to be running in
828 // order to create mirror window. Run it after the main message loop 834 // order to create mirror window. Run it after the main message loop
829 // is started. 835 // is started.
830 display_manager_->CreateMirrorWindowAsyncIfAny(); 836 display_manager_->CreateMirrorWindowAsyncIfAny();
831 837
832 for (auto& observer : *wm_shell_->shell_observers()) 838 for (auto& observer : *wm_shell_->shell_observers())
833 observer.OnShellInitialized(); 839 observer.OnShellInitialized();
834 840
835 user_metrics_recorder_->OnShellInitialized(); 841 user_metrics_recorder_->OnShellInitialized();
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { 904 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const {
899 return std::unique_ptr<ui::EventTargetIterator>(); 905 return std::unique_ptr<ui::EventTargetIterator>();
900 } 906 }
901 907
902 ui::EventTargeter* Shell::GetEventTargeter() { 908 ui::EventTargeter* Shell::GetEventTargeter() {
903 NOTREACHED(); 909 NOTREACHED();
904 return nullptr; 910 return nullptr;
905 } 911 }
906 912
907 } // namespace ash 913 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698