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

Side by Side Diff: ash/root_window_controller.cc

Issue 2899253002: chromeos: Rename ash::WmShelf to Shelf (Closed)
Patch Set: rebase Created 3 years, 7 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 | « ash/root_window_controller.h ('k') | ash/screen_util.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 <algorithm> 7 #include <algorithm>
8 #include <queue> 8 #include <queue>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ash/ash_constants.h" 11 #include "ash/ash_constants.h"
12 #include "ash/ash_switches.h" 12 #include "ash/ash_switches.h"
13 #include "ash/ash_touch_exploration_manager_chromeos.h" 13 #include "ash/ash_touch_exploration_manager_chromeos.h"
14 #include "ash/focus_cycler.h" 14 #include "ash/focus_cycler.h"
15 #include "ash/high_contrast/high_contrast_controller.h" 15 #include "ash/high_contrast/high_contrast_controller.h"
16 #include "ash/host/ash_window_tree_host.h" 16 #include "ash/host/ash_window_tree_host.h"
17 #include "ash/login_status.h" 17 #include "ash/login_status.h"
18 #include "ash/public/cpp/config.h" 18 #include "ash/public/cpp/config.h"
19 #include "ash/public/cpp/shelf_types.h" 19 #include "ash/public/cpp/shelf_types.h"
20 #include "ash/public/cpp/shell_window_ids.h" 20 #include "ash/public/cpp/shell_window_ids.h"
21 #include "ash/root_window_settings.h" 21 #include "ash/root_window_settings.h"
22 #include "ash/screen_util.h" 22 #include "ash/screen_util.h"
23 #include "ash/session/session_controller.h" 23 #include "ash/session/session_controller.h"
24 #include "ash/shelf/shelf.h"
24 #include "ash/shelf/shelf_layout_manager.h" 25 #include "ash/shelf/shelf_layout_manager.h"
25 #include "ash/shelf/shelf_widget.h" 26 #include "ash/shelf/shelf_widget.h"
26 #include "ash/shelf/shelf_window_targeter.h" 27 #include "ash/shelf/shelf_window_targeter.h"
27 #include "ash/shelf/wm_shelf.h"
28 #include "ash/shell.h" 28 #include "ash/shell.h"
29 #include "ash/shell_delegate.h" 29 #include "ash/shell_delegate.h"
30 #include "ash/shell_port.h" 30 #include "ash/shell_port.h"
31 #include "ash/system/status_area_layout_manager.h" 31 #include "ash/system/status_area_layout_manager.h"
32 #include "ash/system/status_area_widget.h" 32 #include "ash/system/status_area_widget.h"
33 #include "ash/system/tray/system_tray_delegate.h" 33 #include "ash/system/tray/system_tray_delegate.h"
34 #include "ash/touch/touch_hud_debug.h" 34 #include "ash/touch/touch_hud_debug.h"
35 #include "ash/touch/touch_hud_projection.h" 35 #include "ash/touch/touch_hud_projection.h"
36 #include "ash/touch/touch_observer_hud.h" 36 #include "ash/touch/touch_observer_hud.h"
37 #include "ash/wallpaper/wallpaper_delegate.h" 37 #include "ash/wallpaper/wallpaper_delegate.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 wm::WorkspaceWindowState RootWindowController::GetWorkspaceWindowState() { 348 wm::WorkspaceWindowState RootWindowController::GetWorkspaceWindowState() {
349 return workspace_controller_ ? workspace_controller()->GetWindowState() 349 return workspace_controller_ ? workspace_controller()->GetWindowState()
350 : wm::WORKSPACE_WINDOW_STATE_DEFAULT; 350 : wm::WORKSPACE_WINDOW_STATE_DEFAULT;
351 } 351 }
352 352
353 void RootWindowController::InitializeShelf() { 353 void RootWindowController::InitializeShelf() {
354 if (shelf_initialized_) 354 if (shelf_initialized_)
355 return; 355 return;
356 shelf_initialized_ = true; 356 shelf_initialized_ = true;
357 wm_shelf_->NotifyShelfInitialized(); 357 shelf_->NotifyShelfInitialized();
358 358
359 // TODO(jamescook): Pass |wm_shelf_| into the constructors for these layout 359 // TODO(jamescook): Pass |shelf_| into the constructors for these layout
360 // managers. 360 // managers.
361 if (panel_layout_manager_) 361 if (panel_layout_manager_)
362 panel_layout_manager_->SetShelf(wm_shelf_.get()); 362 panel_layout_manager_->SetShelf(shelf_.get());
363 363
364 // TODO(jamescook): Eliminate this. Refactor AttachedPanelWidgetTargeter's 364 // TODO(jamescook): Eliminate this. Refactor AttachedPanelWidgetTargeter's
365 // access to WmShelf. 365 // access to Shelf.
366 Shell::Get()->NotifyShelfCreatedForRootWindow(WmWindow::Get(GetRootWindow())); 366 Shell::Get()->NotifyShelfCreatedForRootWindow(WmWindow::Get(GetRootWindow()));
367 367
368 wm_shelf_->shelf_widget()->PostCreateShelf(); 368 shelf_->shelf_widget()->PostCreateShelf();
369 } 369 }
370 370
371 ShelfLayoutManager* RootWindowController::GetShelfLayoutManager() { 371 ShelfLayoutManager* RootWindowController::GetShelfLayoutManager() {
372 return wm_shelf_->shelf_layout_manager(); 372 return shelf_->shelf_layout_manager();
373 } 373 }
374 374
375 SystemModalContainerLayoutManager* 375 SystemModalContainerLayoutManager*
376 RootWindowController::GetSystemModalLayoutManager(aura::Window* window) { 376 RootWindowController::GetSystemModalLayoutManager(aura::Window* window) {
377 aura::Window* modal_container = nullptr; 377 aura::Window* modal_container = nullptr;
378 if (window) { 378 if (window) {
379 aura::Window* window_container = wm::GetContainerForWindow(window); 379 aura::Window* window_container = wm::GetContainerForWindow(window);
380 if (window_container && 380 if (window_container &&
381 window_container->id() >= kShellWindowId_LockScreenContainer) { 381 window_container->id() >= kShellWindowId_LockScreenContainer) {
382 modal_container = GetContainer(kShellWindowId_LockSystemModalContainer); 382 modal_container = GetContainer(kShellWindowId_LockSystemModalContainer);
383 } else { 383 } else {
384 modal_container = GetContainer(kShellWindowId_SystemModalContainer); 384 modal_container = GetContainer(kShellWindowId_SystemModalContainer);
385 } 385 }
386 } else { 386 } else {
387 int modal_window_id = 387 int modal_window_id =
388 Shell::Get()->session_controller()->IsUserSessionBlocked() 388 Shell::Get()->session_controller()->IsUserSessionBlocked()
389 ? kShellWindowId_LockSystemModalContainer 389 ? kShellWindowId_LockSystemModalContainer
390 : kShellWindowId_SystemModalContainer; 390 : kShellWindowId_SystemModalContainer;
391 modal_container = GetContainer(modal_window_id); 391 modal_container = GetContainer(modal_window_id);
392 } 392 }
393 return modal_container ? static_cast<SystemModalContainerLayoutManager*>( 393 return modal_container ? static_cast<SystemModalContainerLayoutManager*>(
394 modal_container->layout_manager()) 394 modal_container->layout_manager())
395 : nullptr; 395 : nullptr;
396 } 396 }
397 397
398 StatusAreaWidget* RootWindowController::GetStatusAreaWidget() { 398 StatusAreaWidget* RootWindowController::GetStatusAreaWidget() {
399 ShelfWidget* shelf_widget = wm_shelf_->shelf_widget(); 399 ShelfWidget* shelf_widget = shelf_->shelf_widget();
400 return shelf_widget ? shelf_widget->status_area_widget() : nullptr; 400 return shelf_widget ? shelf_widget->status_area_widget() : nullptr;
401 } 401 }
402 402
403 SystemTray* RootWindowController::GetSystemTray() { 403 SystemTray* RootWindowController::GetSystemTray() {
404 // We assume in throughout the code that this will not return NULL. If code 404 // We assume in throughout the code that this will not return NULL. If code
405 // triggers this for valid reasons, it should test status_area_widget first. 405 // triggers this for valid reasons, it should test status_area_widget first.
406 CHECK(wm_shelf_->shelf_widget()->status_area_widget()); 406 CHECK(shelf_->shelf_widget()->status_area_widget());
407 return wm_shelf_->shelf_widget()->status_area_widget()->system_tray(); 407 return shelf_->shelf_widget()->status_area_widget()->system_tray();
408 } 408 }
409 409
410 bool RootWindowController::CanWindowReceiveEvents(aura::Window* window) { 410 bool RootWindowController::CanWindowReceiveEvents(aura::Window* window) {
411 if (GetRootWindow() != window->GetRootWindow()) 411 if (GetRootWindow() != window->GetRootWindow())
412 return false; 412 return false;
413 413
414 // Always allow events to fall through to the virtual keyboard even if 414 // Always allow events to fall through to the virtual keyboard even if
415 // displaying a system modal dialog. 415 // displaying a system modal dialog.
416 if (IsVirtualKeyboardWindow(window)) 416 if (IsVirtualKeyboardWindow(window))
417 return true; 417 return true;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 // Deactivate keyboard container before closing child windows and shutting 550 // Deactivate keyboard container before closing child windows and shutting
551 // down associated layout managers. 551 // down associated layout managers.
552 DeactivateKeyboard(keyboard::KeyboardController::GetInstance()); 552 DeactivateKeyboard(keyboard::KeyboardController::GetInstance());
553 553
554 // |panel_layout_manager_| needs to be shut down before windows are destroyed. 554 // |panel_layout_manager_| needs to be shut down before windows are destroyed.
555 if (panel_layout_manager_) { 555 if (panel_layout_manager_) {
556 panel_layout_manager_->Shutdown(); 556 panel_layout_manager_->Shutdown();
557 panel_layout_manager_ = nullptr; 557 panel_layout_manager_ = nullptr;
558 } 558 }
559 559
560 WmShelf* shelf = GetShelf(); 560 Shelf* shelf = GetShelf();
561 shelf->ShutdownShelfWidget(); 561 shelf->ShutdownShelfWidget();
562 562
563 workspace_controller_.reset(); 563 workspace_controller_.reset();
564 564
565 // Explicitly destroy top level windows. We do this because such windows may 565 // Explicitly destroy top level windows. We do this because such windows may
566 // query the RootWindow for state. 566 // query the RootWindow for state.
567 aura::WindowTracker non_toplevel_windows; 567 aura::WindowTracker non_toplevel_windows;
568 WmWindow* root = GetWindow(); 568 WmWindow* root = GetWindow();
569 non_toplevel_windows.Add(root->aura_window()); 569 non_toplevel_windows.Add(root->aura_window());
570 while (!non_toplevel_windows.windows().empty()) { 570 while (!non_toplevel_windows.windows().empty()) {
(...skipping 25 matching lines...) Expand all
596 aura::client::SetTooltipClient(GetRootWindow(), nullptr); 596 aura::client::SetTooltipClient(GetRootWindow(), nullptr);
597 } 597 }
598 598
599 void RootWindowController::MoveWindowsTo(aura::Window* dst) { 599 void RootWindowController::MoveWindowsTo(aura::Window* dst) {
600 // Clear the workspace controller, so it doesn't incorrectly update the shelf. 600 // Clear the workspace controller, so it doesn't incorrectly update the shelf.
601 workspace_controller_.reset(); 601 workspace_controller_.reset();
602 ReparentAllWindows(GetRootWindow(), dst); 602 ReparentAllWindows(GetRootWindow(), dst);
603 } 603 }
604 604
605 void RootWindowController::UpdateShelfVisibility() { 605 void RootWindowController::UpdateShelfVisibility() {
606 wm_shelf_->UpdateVisibilityState(); 606 shelf_->UpdateVisibilityState();
607 } 607 }
608 608
609 void RootWindowController::InitTouchHuds() { 609 void RootWindowController::InitTouchHuds() {
610 if (Shell::GetAshConfig() == Config::MASH) 610 if (Shell::GetAshConfig() == Config::MASH)
611 return; 611 return;
612 612
613 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 613 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
614 if (command_line->HasSwitch(switches::kAshTouchHud)) 614 if (command_line->HasSwitch(switches::kAshTouchHud))
615 set_touch_hud_debug(new TouchHudDebug(GetRootWindow())); 615 set_touch_hud_debug(new TouchHudDebug(GetRootWindow()));
616 if (Shell::Get()->is_touch_hud_projection_enabled()) 616 if (Shell::Get()->is_touch_hud_projection_enabled())
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 void RootWindowController::SetTouchAccessibilityAnchorPoint( 664 void RootWindowController::SetTouchAccessibilityAnchorPoint(
665 const gfx::Point& anchor_point) { 665 const gfx::Point& anchor_point) {
666 if (touch_exploration_manager_) 666 if (touch_exploration_manager_)
667 touch_exploration_manager_->SetTouchAccessibilityAnchorPoint(anchor_point); 667 touch_exploration_manager_->SetTouchAccessibilityAnchorPoint(anchor_point);
668 } 668 }
669 669
670 void RootWindowController::ShowContextMenu(const gfx::Point& location_in_screen, 670 void RootWindowController::ShowContextMenu(const gfx::Point& location_in_screen,
671 ui::MenuSourceType source_type) { 671 ui::MenuSourceType source_type) {
672 ShellDelegate* delegate = Shell::Get()->shell_delegate(); 672 ShellDelegate* delegate = Shell::Get()->shell_delegate();
673 DCHECK(delegate); 673 DCHECK(delegate);
674 menu_model_.reset(delegate->CreateContextMenu(wm_shelf_.get(), nullptr)); 674 menu_model_.reset(delegate->CreateContextMenu(shelf_.get(), nullptr));
675 if (!menu_model_) 675 if (!menu_model_)
676 return; 676 return;
677 677
678 menu_model_adapter_ = base::MakeUnique<views::MenuModelAdapter>( 678 menu_model_adapter_ = base::MakeUnique<views::MenuModelAdapter>(
679 menu_model_.get(), 679 menu_model_.get(),
680 base::Bind(&RootWindowController::OnMenuClosed, base::Unretained(this))); 680 base::Bind(&RootWindowController::OnMenuClosed, base::Unretained(this)));
681 681
682 // The wallpaper controller may not be set yet if the user clicked on the 682 // The wallpaper controller may not be set yet if the user clicked on the
683 // status area before the initial animation completion. See crbug.com/222218 683 // status area before the initial animation completion. See crbug.com/222218
684 if (!wallpaper_widget_controller()) 684 if (!wallpaper_widget_controller())
685 return; 685 return;
686 686
687 menu_runner_ = base::MakeUnique<views::MenuRunner>( 687 menu_runner_ = base::MakeUnique<views::MenuRunner>(
688 menu_model_adapter_->CreateMenu(), views::MenuRunner::CONTEXT_MENU); 688 menu_model_adapter_->CreateMenu(), views::MenuRunner::CONTEXT_MENU);
689 menu_runner_->RunMenuAt(wallpaper_widget_controller()->widget(), nullptr, 689 menu_runner_->RunMenuAt(wallpaper_widget_controller()->widget(), nullptr,
690 gfx::Rect(location_in_screen, gfx::Size()), 690 gfx::Rect(location_in_screen, gfx::Size()),
691 views::MENU_ANCHOR_TOPLEFT, source_type); 691 views::MENU_ANCHOR_TOPLEFT, source_type);
692 } 692 }
693 693
694 void RootWindowController::UpdateAfterLoginStatusChange(LoginStatus status) { 694 void RootWindowController::UpdateAfterLoginStatusChange(LoginStatus status) {
695 StatusAreaWidget* status_area_widget = 695 StatusAreaWidget* status_area_widget =
696 wm_shelf_->shelf_widget()->status_area_widget(); 696 shelf_->shelf_widget()->status_area_widget();
697 if (status_area_widget) 697 if (status_area_widget)
698 status_area_widget->UpdateAfterLoginStatusChange(status); 698 status_area_widget->UpdateAfterLoginStatusChange(status);
699 } 699 }
700 700
701 //////////////////////////////////////////////////////////////////////////////// 701 ////////////////////////////////////////////////////////////////////////////////
702 // RootWindowController, private: 702 // RootWindowController, private:
703 703
704 RootWindowController::RootWindowController( 704 RootWindowController::RootWindowController(
705 AshWindowTreeHost* ash_host, 705 AshWindowTreeHost* ash_host,
706 aura::WindowTreeHost* window_tree_host) 706 aura::WindowTreeHost* window_tree_host)
707 : ash_host_(ash_host), 707 : ash_host_(ash_host),
708 mus_window_tree_host_(window_tree_host), 708 mus_window_tree_host_(window_tree_host),
709 window_tree_host_(ash_host ? ash_host->AsWindowTreeHost() 709 window_tree_host_(ash_host ? ash_host->AsWindowTreeHost()
710 : window_tree_host), 710 : window_tree_host),
711 wm_shelf_(base::MakeUnique<WmShelf>()) { 711 shelf_(base::MakeUnique<Shelf>()) {
712 DCHECK((ash_host && !window_tree_host) || (!ash_host && window_tree_host)); 712 DCHECK((ash_host && !window_tree_host) || (!ash_host && window_tree_host));
713 713
714 if (!root_window_controllers_) 714 if (!root_window_controllers_)
715 root_window_controllers_ = new std::vector<RootWindowController*>; 715 root_window_controllers_ = new std::vector<RootWindowController*>;
716 root_window_controllers_->push_back(this); 716 root_window_controllers_->push_back(this);
717 717
718 aura::Window* root_window = GetRootWindow(); 718 aura::Window* root_window = GetRootWindow();
719 GetRootWindowSettings(root_window)->controller = this; 719 GetRootWindowSettings(root_window)->controller = this;
720 720
721 stacking_controller_.reset(new StackingController); 721 stacking_controller_.reset(new StackingController);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 // http://crbug.com/679782 764 // http://crbug.com/679782
765 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 765 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
766 switches::kAshDisableTouchExplorationMode) && 766 switches::kAshDisableTouchExplorationMode) &&
767 Shell::GetAshConfig() != Config::MASH) { 767 Shell::GetAshConfig() != Config::MASH) {
768 touch_exploration_manager_.reset(new AshTouchExplorationManager(this)); 768 touch_exploration_manager_.reset(new AshTouchExplorationManager(this));
769 } 769 }
770 } 770 }
771 771
772 void RootWindowController::InitLayoutManagers() { 772 void RootWindowController::InitLayoutManagers() {
773 // Create the shelf and status area widgets. 773 // Create the shelf and status area widgets.
774 DCHECK(!wm_shelf_->shelf_widget()); 774 DCHECK(!shelf_->shelf_widget());
775 GetShelf()->CreateShelfWidget(GetWindow()); 775 GetShelf()->CreateShelfWidget(GetWindow());
776 776
777 aura::Window* root = GetRootWindow(); 777 aura::Window* root = GetRootWindow();
778 root_window_layout_manager_ = new wm::RootWindowLayoutManager(root); 778 root_window_layout_manager_ = new wm::RootWindowLayoutManager(root);
779 root->SetLayoutManager(root_window_layout_manager_); 779 root->SetLayoutManager(root_window_layout_manager_);
780 780
781 aura::Window* default_container = 781 aura::Window* default_container =
782 GetContainer(kShellWindowId_DefaultContainer); 782 GetContainer(kShellWindowId_DefaultContainer);
783 // Installs WorkspaceLayoutManager on |default_container|. 783 // Installs WorkspaceLayoutManager on |default_container|.
784 workspace_controller_.reset(new WorkspaceController(default_container)); 784 workspace_controller_.reset(new WorkspaceController(default_container));
(...skipping 23 matching lines...) Expand all
808 // Create Panel layout manager 808 // Create Panel layout manager
809 aura::Window* panel_container = GetContainer(kShellWindowId_PanelContainer); 809 aura::Window* panel_container = GetContainer(kShellWindowId_PanelContainer);
810 panel_layout_manager_ = new PanelLayoutManager(panel_container); 810 panel_layout_manager_ = new PanelLayoutManager(panel_container);
811 panel_container->SetLayoutManager(panel_layout_manager_); 811 panel_container->SetLayoutManager(panel_layout_manager_);
812 812
813 wm::WmSnapToPixelLayoutManager::InstallOnContainers(root); 813 wm::WmSnapToPixelLayoutManager::InstallOnContainers(root);
814 814
815 // Make it easier to resize windows that partially overlap the shelf. Must 815 // Make it easier to resize windows that partially overlap the shelf. Must
816 // occur after the ShelfLayoutManager is constructed by ShelfWidget. 816 // occur after the ShelfLayoutManager is constructed by ShelfWidget.
817 aura::Window* shelf_container = GetContainer(kShellWindowId_ShelfContainer); 817 aura::Window* shelf_container = GetContainer(kShellWindowId_ShelfContainer);
818 WmWindow* wm_shelf_container = WmWindow::Get(shelf_container);
819 shelf_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>( 818 shelf_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>(
820 wm_shelf_container, wm_shelf_.get())); 819 WmWindow::Get(shelf_container), shelf_.get()));
821 aura::Window* status_container = GetContainer(kShellWindowId_StatusContainer); 820 aura::Window* status_container = GetContainer(kShellWindowId_StatusContainer);
822 WmWindow* wm_status_container = WmWindow::Get(status_container);
823 status_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>( 821 status_container->SetEventTargeter(base::MakeUnique<ShelfWindowTargeter>(
824 wm_status_container, wm_shelf_.get())); 822 WmWindow::Get(status_container), shelf_.get()));
825 823
826 panel_container_handler_ = base::MakeUnique<PanelWindowEventHandler>(); 824 panel_container_handler_ = base::MakeUnique<PanelWindowEventHandler>();
827 GetContainer(kShellWindowId_PanelContainer) 825 GetContainer(kShellWindowId_PanelContainer)
828 ->AddPreTargetHandler(panel_container_handler_.get()); 826 ->AddPreTargetHandler(panel_container_handler_.get());
829 827
830 // Install an AttachedPanelWindowTargeter on the panel container to make it 828 // Install an AttachedPanelWindowTargeter on the panel container to make it
831 // easier to correctly target shelf buttons with touch. 829 // easier to correctly target shelf buttons with touch.
832 gfx::Insets mouse_extend(-kResizeOutsideBoundsSize, -kResizeOutsideBoundsSize, 830 gfx::Insets mouse_extend(-kResizeOutsideBoundsSize, -kResizeOutsideBoundsSize,
833 -kResizeOutsideBoundsSize, 831 -kResizeOutsideBoundsSize,
834 -kResizeOutsideBoundsSize); 832 -kResizeOutsideBoundsSize);
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 aura::Window* primary_root = Shell::GetPrimaryRootWindow(); 1064 aura::Window* primary_root = Shell::GetPrimaryRootWindow();
1067 Shell::Get()->set_root_window_for_new_windows( 1065 Shell::Get()->set_root_window_for_new_windows(
1068 primary_root == root ? nullptr : primary_root); 1066 primary_root == root ? nullptr : primary_root);
1069 } 1067 }
1070 } 1068 }
1071 1069
1072 void RootWindowController::OnMenuClosed() { 1070 void RootWindowController::OnMenuClosed() {
1073 menu_runner_.reset(); 1071 menu_runner_.reset();
1074 menu_model_adapter_.reset(); 1072 menu_model_adapter_.reset();
1075 menu_model_.reset(); 1073 menu_model_.reset();
1076 wm_shelf_->UpdateVisibilityState(); 1074 shelf_->UpdateVisibilityState();
1077 } 1075 }
1078 1076
1079 void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { 1077 void RootWindowController::OnTouchHudProjectionToggled(bool enabled) {
1080 if (enabled) 1078 if (enabled)
1081 EnableTouchHudProjection(); 1079 EnableTouchHudProjection();
1082 else 1080 else
1083 DisableTouchHudProjection(); 1081 DisableTouchHudProjection();
1084 } 1082 }
1085 1083
1086 RootWindowController* GetRootWindowController(const aura::Window* root_window) { 1084 RootWindowController* GetRootWindowController(const aura::Window* root_window) {
1087 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; 1085 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr;
1088 } 1086 }
1089 1087
1090 } // namespace ash 1088 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller.h ('k') | ash/screen_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698