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

Side by Side Diff: ash/root_window_controller.cc

Issue 2222093003: ash: Move ShelfWindowTargeter construction from ShelfWidget to RootWindowController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | ash/shelf/shelf_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/root_window_controller.h" 5 #include "ash/root_window_controller.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/aura/aura_layout_manager_adapter.h" 10 #include "ash/aura/aura_layout_manager_adapter.h"
(...skipping 24 matching lines...) Expand all
35 #include "ash/common/wm_window.h" 35 #include "ash/common/wm_window.h"
36 #include "ash/desktop_background/desktop_background_widget_controller.h" 36 #include "ash/desktop_background/desktop_background_widget_controller.h"
37 #include "ash/desktop_background/user_wallpaper_delegate.h" 37 #include "ash/desktop_background/user_wallpaper_delegate.h"
38 #include "ash/display/display_manager.h" 38 #include "ash/display/display_manager.h"
39 #include "ash/high_contrast/high_contrast_controller.h" 39 #include "ash/high_contrast/high_contrast_controller.h"
40 #include "ash/host/ash_window_tree_host.h" 40 #include "ash/host/ash_window_tree_host.h"
41 #include "ash/root_window_settings.h" 41 #include "ash/root_window_settings.h"
42 #include "ash/shelf/shelf.h" 42 #include "ash/shelf/shelf.h"
43 #include "ash/shelf/shelf_layout_manager.h" 43 #include "ash/shelf/shelf_layout_manager.h"
44 #include "ash/shelf/shelf_widget.h" 44 #include "ash/shelf/shelf_widget.h"
45 #include "ash/shelf/shelf_window_targeter.h"
45 #include "ash/shell.h" 46 #include "ash/shell.h"
46 #include "ash/touch/touch_hud_debug.h" 47 #include "ash/touch/touch_hud_debug.h"
47 #include "ash/touch/touch_hud_projection.h" 48 #include "ash/touch/touch_hud_projection.h"
48 #include "ash/touch/touch_observer_hud.h" 49 #include "ash/touch/touch_observer_hud.h"
49 #include "ash/wm/lock_layout_manager.h" 50 #include "ash/wm/lock_layout_manager.h"
50 #include "ash/wm/panels/attached_panel_window_targeter.h" 51 #include "ash/wm/panels/attached_panel_window_targeter.h"
51 #include "ash/wm/panels/panel_window_event_handler.h" 52 #include "ash/wm/panels/panel_window_event_handler.h"
52 #include "ash/wm/stacking_controller.h" 53 #include "ash/wm/stacking_controller.h"
53 #include "ash/wm/status_area_layout_manager.h" 54 #include "ash/wm/status_area_layout_manager.h"
54 #include "ash/wm/system_background_controller.h" 55 #include "ash/wm/system_background_controller.h"
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 WorkspaceLayoutManagerDelegateImpl* workspace_layout_manager_delegate = 845 WorkspaceLayoutManagerDelegateImpl* workspace_layout_manager_delegate =
845 new WorkspaceLayoutManagerDelegateImpl(root_window); 846 new WorkspaceLayoutManagerDelegateImpl(root_window);
846 workspace_controller_.reset(new WorkspaceController( 847 workspace_controller_.reset(new WorkspaceController(
847 default_container, base::WrapUnique(workspace_layout_manager_delegate))); 848 default_container, base::WrapUnique(workspace_layout_manager_delegate)));
848 849
849 WmWindow* always_on_top_container = 850 WmWindow* always_on_top_container =
850 WmWindowAura::Get(GetContainer(kShellWindowId_AlwaysOnTopContainer)); 851 WmWindowAura::Get(GetContainer(kShellWindowId_AlwaysOnTopContainer));
851 always_on_top_controller_.reset( 852 always_on_top_controller_.reset(
852 new AlwaysOnTopController(always_on_top_container)); 853 new AlwaysOnTopController(always_on_top_container));
853 854
855 // Create the shelf and status area widgets.
854 DCHECK(!shelf_widget_.get()); 856 DCHECK(!shelf_widget_.get());
855 WmWindow* shelf_container = 857 aura::Window* shelf_container = GetContainer(kShellWindowId_ShelfContainer);
856 WmWindowAura::Get(GetContainer(kShellWindowId_ShelfContainer)); 858 aura::Window* status_container = GetContainer(kShellWindowId_StatusContainer);
857 WmWindow* status_container = 859 WmWindow* wm_shelf_container = WmWindowAura::Get(shelf_container);
858 WmWindowAura::Get(GetContainer(kShellWindowId_StatusContainer)); 860 WmWindow* wm_status_container = WmWindowAura::Get(status_container);
859 shelf_widget_.reset(new ShelfWidget(shelf_container, status_container, 861 shelf_widget_.reset(new ShelfWidget(wm_shelf_container, wm_status_container,
860 wm_shelf_aura_.get(), 862 wm_shelf_aura_.get(),
861 workspace_controller())); 863 workspace_controller()));
864 // Make it easier to resize windows that partially overlap the shelf. Must
865 // occur after the ShelfLayoutManager is constructed by ShelfWidget.
866 shelf_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>(
867 wm_shelf_container, wm_shelf_aura_.get()));
868 status_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>(
869 wm_status_container, wm_shelf_aura_.get()));
870
862 workspace_layout_manager_delegate->set_shelf( 871 workspace_layout_manager_delegate->set_shelf(
863 shelf_widget_->shelf_layout_manager()); 872 shelf_widget_->shelf_layout_manager());
864 873
865 if (!WmShell::Get() 874 if (!WmShell::Get()
866 ->GetSessionStateDelegate() 875 ->GetSessionStateDelegate()
867 ->IsActiveUserSessionStarted()) { 876 ->IsActiveUserSessionStarted()) {
868 // This window exists only to be a event target on login screen. 877 // This window exists only to be a event target on login screen.
869 // It does not have to handle events, nor be visible. 878 // It does not have to handle events, nor be visible.
870 mouse_event_target_.reset(new aura::Window(new EmptyWindowDelegate)); 879 mouse_event_target_.reset(new aura::Window(new EmptyWindowDelegate));
871 mouse_event_target_->Init(ui::LAYER_NOT_DRAWN); 880 mouse_event_target_->Init(ui::LAYER_NOT_DRAWN);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 aura::Window* primary_root_window = Shell::GetInstance() 988 aura::Window* primary_root_window = Shell::GetInstance()
980 ->window_tree_host_manager() 989 ->window_tree_host_manager()
981 ->GetPrimaryRootWindow(); 990 ->GetPrimaryRootWindow();
982 return GetRootWindowSettings(primary_root_window)->controller; 991 return GetRootWindowSettings(primary_root_window)->controller;
983 } 992 }
984 993
985 return GetRootWindowSettings(root_window)->controller; 994 return GetRootWindowSettings(root_window)->controller;
986 } 995 }
987 996
988 } // namespace ash 997 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/shelf/shelf_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698