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

Side by Side Diff: ash/shell.cc

Issue 2918403006: CrOS Tablet Window management - Split Screen part I (Closed)
Patch Set: Fix failed tests. Created 3 years, 6 months 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 #include "ash/wm/lock_state_controller.h" 100 #include "ash/wm/lock_state_controller.h"
101 #include "ash/wm/maximize_mode/maximize_mode_controller.h" 101 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
102 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" 102 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h"
103 #include "ash/wm/mru_window_tracker.h" 103 #include "ash/wm/mru_window_tracker.h"
104 #include "ash/wm/overlay_event_filter.h" 104 #include "ash/wm/overlay_event_filter.h"
105 #include "ash/wm/overview/window_selector_controller.h" 105 #include "ash/wm/overview/window_selector_controller.h"
106 #include "ash/wm/power_button_controller.h" 106 #include "ash/wm/power_button_controller.h"
107 #include "ash/wm/resize_shadow_controller.h" 107 #include "ash/wm/resize_shadow_controller.h"
108 #include "ash/wm/root_window_finder.h" 108 #include "ash/wm/root_window_finder.h"
109 #include "ash/wm/screen_pinning_controller.h" 109 #include "ash/wm/screen_pinning_controller.h"
110 #include "ash/wm/splitview/split_view_controller.h"
110 #include "ash/wm/system_gesture_event_filter.h" 111 #include "ash/wm/system_gesture_event_filter.h"
111 #include "ash/wm/system_modal_container_event_filter.h" 112 #include "ash/wm/system_modal_container_event_filter.h"
112 #include "ash/wm/system_modal_container_layout_manager.h" 113 #include "ash/wm/system_modal_container_layout_manager.h"
113 #include "ash/wm/toplevel_window_event_handler.h" 114 #include "ash/wm/toplevel_window_event_handler.h"
114 #include "ash/wm/video_detector.h" 115 #include "ash/wm/video_detector.h"
115 #include "ash/wm/window_animations.h" 116 #include "ash/wm/window_animations.h"
116 #include "ash/wm/window_cycle_controller.h" 117 #include "ash/wm/window_cycle_controller.h"
117 #include "ash/wm/window_positioner.h" 118 #include "ash/wm/window_positioner.h"
118 #include "ash/wm/window_properties.h" 119 #include "ash/wm/window_properties.h"
119 #include "ash/wm/window_util.h" 120 #include "ash/wm/window_util.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 native_cursor_manager_->SetNativeCursorEnabled(!enabled); 445 native_cursor_manager_->SetNativeCursorEnabled(!enabled);
445 } 446 }
446 } 447 }
447 448
448 void Shell::DoInitialWorkspaceAnimation() { 449 void Shell::DoInitialWorkspaceAnimation() {
449 return GetPrimaryRootWindowController() 450 return GetPrimaryRootWindowController()
450 ->workspace_controller() 451 ->workspace_controller()
451 ->DoInitialAnimation(); 452 ->DoInitialAnimation();
452 } 453 }
453 454
455 bool Shell::IsSplitViewModeActive() const {
456 return split_view_controller_->IsSplitViewModeActive();
457 }
458
454 void Shell::AddShellObserver(ShellObserver* observer) { 459 void Shell::AddShellObserver(ShellObserver* observer) {
455 shell_observers_.AddObserver(observer); 460 shell_observers_.AddObserver(observer);
456 } 461 }
457 462
458 void Shell::RemoveShellObserver(ShellObserver* observer) { 463 void Shell::RemoveShellObserver(ShellObserver* observer) {
459 shell_observers_.RemoveObserver(observer); 464 shell_observers_.RemoveObserver(observer);
460 } 465 }
461 466
462 void Shell::ShowAppList() { 467 void Shell::ShowAppList() {
463 // Show the app list on the default display for new windows. 468 // Show the app list on the default display for new windows.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 void Shell::NotifyOverviewModeStarting() { 514 void Shell::NotifyOverviewModeStarting() {
510 for (auto& observer : shell_observers_) 515 for (auto& observer : shell_observers_)
511 observer.OnOverviewModeStarting(); 516 observer.OnOverviewModeStarting();
512 } 517 }
513 518
514 void Shell::NotifyOverviewModeEnded() { 519 void Shell::NotifyOverviewModeEnded() {
515 for (auto& observer : shell_observers_) 520 for (auto& observer : shell_observers_)
516 observer.OnOverviewModeEnded(); 521 observer.OnOverviewModeEnded();
517 } 522 }
518 523
524 void Shell::NotifySplitViewModeStarting() {
525 for (auto& observer : shell_observers_)
526 observer.OnSplitViewModeStarting();
527 }
528
529 void Shell::NotifySplitViewModeEnded() {
530 for (auto& observer : shell_observers_)
531 observer.OnSplitViewModeEnded();
532 }
533
519 void Shell::NotifyFullscreenStateChanged(bool is_fullscreen, 534 void Shell::NotifyFullscreenStateChanged(bool is_fullscreen,
520 aura::Window* root_window) { 535 aura::Window* root_window) {
521 for (auto& observer : shell_observers_) 536 for (auto& observer : shell_observers_)
522 observer.OnFullscreenStateChanged(is_fullscreen, root_window); 537 observer.OnFullscreenStateChanged(is_fullscreen, root_window);
523 } 538 }
524 539
525 void Shell::NotifyPinnedStateChanged(aura::Window* pinned_window) { 540 void Shell::NotifyPinnedStateChanged(aura::Window* pinned_window) {
526 for (auto& observer : shell_observers_) 541 for (auto& observer : shell_observers_)
527 observer.OnPinnedStateChanged(pinned_window); 542 observer.OnPinnedStateChanged(pinned_window);
528 } 543 }
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 tooltip_controller_.reset(); 721 tooltip_controller_.reset();
707 event_client_.reset(); 722 event_client_.reset();
708 toplevel_window_event_handler_.reset(); 723 toplevel_window_event_handler_.reset();
709 visibility_controller_.reset(); 724 visibility_controller_.reset();
710 725
711 power_button_controller_.reset(); 726 power_button_controller_.reset();
712 lock_state_controller_.reset(); 727 lock_state_controller_.reset();
713 728
714 screen_pinning_controller_.reset(); 729 screen_pinning_controller_.reset();
715 730
731 split_view_controller_.reset();
oshima 2017/06/14 00:19:26 can you keep the reverse order of init process?
xdai1 2017/06/15 22:11:40 Done. However, in line 639 in this patch the comme
oshima 2017/06/16 01:20:56 That's added after we had issues with mixed order.
xdai1 2017/06/16 18:49:52 I see. Thanks!
732
716 resolution_notification_controller_.reset(); 733 resolution_notification_controller_.reset();
717 screenshot_controller_.reset(); 734 screenshot_controller_.reset();
718 mouse_cursor_filter_.reset(); 735 mouse_cursor_filter_.reset();
719 modality_filter_.reset(); 736 modality_filter_.reset();
720 737
721 touch_transformer_controller_.reset(); 738 touch_transformer_controller_.reset();
722 audio_a11y_controller_.reset(); 739 audio_a11y_controller_.reset();
723 laser_pointer_controller_.reset(); 740 laser_pointer_controller_.reset();
724 partial_magnification_controller_.reset(); 741 partial_magnification_controller_.reset();
725 742
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); 1116 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get()));
1100 video_activity_notifier_.reset( 1117 video_activity_notifier_.reset(
1101 new VideoActivityNotifier(video_detector_.get())); 1118 new VideoActivityNotifier(video_detector_.get()));
1102 bluetooth_notification_controller_.reset(new BluetoothNotificationController); 1119 bluetooth_notification_controller_.reset(new BluetoothNotificationController);
1103 if (ShouldEnableSimplifiedDisplayManagement()) { 1120 if (ShouldEnableSimplifiedDisplayManagement()) {
1104 screen_orientation_controller_.reset(new ScreenOrientationController()); 1121 screen_orientation_controller_.reset(new ScreenOrientationController());
1105 screen_layout_observer_.reset(new ScreenLayoutObserver()); 1122 screen_layout_observer_.reset(new ScreenLayoutObserver());
1106 } 1123 }
1107 sms_observer_.reset(new SmsObserver()); 1124 sms_observer_.reset(new SmsObserver());
1108 1125
1126 split_view_controller_.reset(new SplitViewController());
1127
1109 // The compositor thread and main message loop have to be running in 1128 // The compositor thread and main message loop have to be running in
1110 // order to create mirror window. Run it after the main message loop 1129 // order to create mirror window. Run it after the main message loop
1111 // is started. 1130 // is started.
1112 if (ShouldEnableSimplifiedDisplayManagement()) 1131 if (ShouldEnableSimplifiedDisplayManagement())
1113 display_manager_->CreateMirrorWindowAsyncIfAny(); 1132 display_manager_->CreateMirrorWindowAsyncIfAny();
1114 1133
1115 for (auto& observer : shell_observers_) 1134 for (auto& observer : shell_observers_)
1116 observer.OnShellInitialized(); 1135 observer.OnShellInitialized();
1117 1136
1118 if (config != Config::MASH) 1137 if (config != Config::MASH)
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 void Shell::OnPrefServiceInitialized( 1293 void Shell::OnPrefServiceInitialized(
1275 std::unique_ptr<::PrefService> pref_service) { 1294 std::unique_ptr<::PrefService> pref_service) {
1276 if (!instance_) 1295 if (!instance_)
1277 return; 1296 return;
1278 // |pref_service_| is null if can't connect to Chrome (as happens when 1297 // |pref_service_| is null if can't connect to Chrome (as happens when
1279 // running mash outside of chrome --mash and chrome isn't built). 1298 // running mash outside of chrome --mash and chrome isn't built).
1280 pref_service_ = std::move(pref_service); 1299 pref_service_ = std::move(pref_service);
1281 } 1300 }
1282 1301
1283 } // namespace ash 1302 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698