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

Side by Side Diff: ash/shell.cc

Issue 178183005: Add LogoutConfirmationController to show LogoutConfirmationDialogs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed. Rebased. Created 6 years, 9 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 | Annotate | Revision Log
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 9
10 #include "ash/accelerators/accelerator_controller.h" 10 #include "ash/accelerators/accelerator_controller.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "ash/shelf/shelf_item_delegate.h" 42 #include "ash/shelf/shelf_item_delegate.h"
43 #include "ash/shelf/shelf_item_delegate_manager.h" 43 #include "ash/shelf/shelf_item_delegate_manager.h"
44 #include "ash/shelf/shelf_layout_manager.h" 44 #include "ash/shelf/shelf_layout_manager.h"
45 #include "ash/shelf/shelf_model.h" 45 #include "ash/shelf/shelf_model.h"
46 #include "ash/shelf/shelf_widget.h" 46 #include "ash/shelf/shelf_widget.h"
47 #include "ash/shelf/shelf_window_watcher.h" 47 #include "ash/shelf/shelf_window_watcher.h"
48 #include "ash/shell_delegate.h" 48 #include "ash/shell_delegate.h"
49 #include "ash/shell_factory.h" 49 #include "ash/shell_factory.h"
50 #include "ash/shell_window_ids.h" 50 #include "ash/shell_window_ids.h"
51 #include "ash/system/locale/locale_notification_controller.h" 51 #include "ash/system/locale/locale_notification_controller.h"
52 #include "ash/system/logout_confirmation/logout_confirmation_controller.h"
52 #include "ash/system/status_area_widget.h" 53 #include "ash/system/status_area_widget.h"
53 #include "ash/system/tray/system_tray_delegate.h" 54 #include "ash/system/tray/system_tray_delegate.h"
54 #include "ash/system/tray/system_tray_notifier.h" 55 #include "ash/system/tray/system_tray_notifier.h"
55 #include "ash/wm/app_list_controller.h" 56 #include "ash/wm/app_list_controller.h"
56 #include "ash/wm/ash_focus_rules.h" 57 #include "ash/wm/ash_focus_rules.h"
57 #include "ash/wm/ash_native_cursor_manager.h" 58 #include "ash/wm/ash_native_cursor_manager.h"
58 #include "ash/wm/coordinate_conversion.h" 59 #include "ash/wm/coordinate_conversion.h"
59 #include "ash/wm/custom_frame_view_ash.h" 60 #include "ash/wm/custom_frame_view_ash.h"
60 #include "ash/wm/event_client_impl.h" 61 #include "ash/wm/event_client_impl.h"
61 #include "ash/wm/lock_state_controller.h" 62 #include "ash/wm/lock_state_controller.h"
(...skipping 11 matching lines...) Expand all
73 #include "ash/wm/toplevel_window_event_handler.h" 74 #include "ash/wm/toplevel_window_event_handler.h"
74 #include "ash/wm/user_activity_detector.h" 75 #include "ash/wm/user_activity_detector.h"
75 #include "ash/wm/video_detector.h" 76 #include "ash/wm/video_detector.h"
76 #include "ash/wm/window_animations.h" 77 #include "ash/wm/window_animations.h"
77 #include "ash/wm/window_cycle_controller.h" 78 #include "ash/wm/window_cycle_controller.h"
78 #include "ash/wm/window_positioner.h" 79 #include "ash/wm/window_positioner.h"
79 #include "ash/wm/window_properties.h" 80 #include "ash/wm/window_properties.h"
80 #include "ash/wm/window_util.h" 81 #include "ash/wm/window_util.h"
81 #include "ash/wm/workspace_controller.h" 82 #include "ash/wm/workspace_controller.h"
82 #include "base/bind.h" 83 #include "base/bind.h"
84 #include "base/bind_helpers.h"
83 #include "base/command_line.h" 85 #include "base/command_line.h"
84 #include "base/debug/trace_event.h" 86 #include "base/debug/trace_event.h"
85 #include "ui/aura/client/aura_constants.h" 87 #include "ui/aura/client/aura_constants.h"
86 #include "ui/aura/client/user_action_client.h" 88 #include "ui/aura/client/user_action_client.h"
87 #include "ui/aura/env.h" 89 #include "ui/aura/env.h"
88 #include "ui/aura/layout_manager.h" 90 #include "ui/aura/layout_manager.h"
89 #include "ui/aura/window.h" 91 #include "ui/aura/window.h"
90 #include "ui/aura/window_event_dispatcher.h" 92 #include "ui/aura/window_event_dispatcher.h"
91 #include "ui/base/ui_base_switches.h" 93 #include "ui/base/ui_base_switches.h"
92 #include "ui/compositor/layer.h" 94 #include "ui/compositor/layer.h"
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 650
649 // TooltipController is deleted with the Shell so removing its references. 651 // TooltipController is deleted with the Shell so removing its references.
650 RemovePreTargetHandler(tooltip_controller_.get()); 652 RemovePreTargetHandler(tooltip_controller_.get());
651 653
652 // AppList needs to be released before shelf layout manager, which is 654 // AppList needs to be released before shelf layout manager, which is
653 // destroyed with shelf container in the loop below. However, app list 655 // destroyed with shelf container in the loop below. However, app list
654 // container is now on top of shelf container and released after it. 656 // container is now on top of shelf container and released after it.
655 // TODO(xiyuan): Move it back when app list container is no longer needed. 657 // TODO(xiyuan): Move it back when app list container is no longer needed.
656 app_list_controller_.reset(); 658 app_list_controller_.reset();
657 659
660 // Destroy the LogoutConfirmationController before the SystemTrayDelegate.
661 logout_confirmation_controller_.reset();
662
658 // Destroy SystemTrayDelegate before destroying the status area(s). 663 // Destroy SystemTrayDelegate before destroying the status area(s).
659 system_tray_delegate_->Shutdown(); 664 system_tray_delegate_->Shutdown();
660 system_tray_delegate_.reset(); 665 system_tray_delegate_.reset();
661 666
662 locale_notification_controller_.reset(); 667 locale_notification_controller_.reset();
663 668
664 // Drag-and-drop must be canceled prior to close all windows. 669 // Drag-and-drop must be canceled prior to close all windows.
665 drag_drop_controller_.reset(); 670 drag_drop_controller_.reset();
666 671
667 // Controllers who have WindowObserver added must be deleted 672 // Controllers who have WindowObserver added must be deleted
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 // Initialize system_tray_delegate_ before initializing StatusAreaWidget. 955 // Initialize system_tray_delegate_ before initializing StatusAreaWidget.
951 system_tray_delegate_.reset(delegate()->CreateSystemTrayDelegate()); 956 system_tray_delegate_.reset(delegate()->CreateSystemTrayDelegate());
952 DCHECK(system_tray_delegate_.get()); 957 DCHECK(system_tray_delegate_.get());
953 958
954 locale_notification_controller_.reset( 959 locale_notification_controller_.reset(
955 new internal::LocaleNotificationController); 960 new internal::LocaleNotificationController);
956 961
957 // Initialize system_tray_delegate_ after StatusAreaWidget is created. 962 // Initialize system_tray_delegate_ after StatusAreaWidget is created.
958 system_tray_delegate_->Initialize(); 963 system_tray_delegate_->Initialize();
959 964
965 // Create the LogoutConfirmationController after the SystemTrayDelegate.
966 logout_confirmation_controller_.reset(
967 new internal::LogoutConfirmationController(
968 base::Bind(&SystemTrayDelegate::SignOut,
969 base::Unretained(system_tray_delegate_.get()))));
970
960 // TODO(oshima): Initialize all RootWindowControllers once, and 971 // TODO(oshima): Initialize all RootWindowControllers once, and
961 // initialize controller/delegates above when initializing the 972 // initialize controller/delegates above when initializing the
962 // primary root window controller. 973 // primary root window controller.
963 internal::RootWindowController::CreateForPrimaryDisplay( 974 internal::RootWindowController::CreateForPrimaryDisplay(
964 root_window->GetDispatcher()->host()); 975 root_window->GetDispatcher()->host());
965 976
966 display_controller_->InitSecondaryDisplays(); 977 display_controller_->InitSecondaryDisplays();
967 978
968 // It needs to be created after RootWindowController has been created 979 // It needs to be created after RootWindowController has been created
969 // (which calls OnWindowResized has been called, otherwise the 980 // (which calls OnWindowResized has been called, otherwise the
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 //////////////////////////////////////////////////////////////////////////////// 1099 ////////////////////////////////////////////////////////////////////////////////
1089 // Shell, aura::client::ActivationChangeObserver implementation: 1100 // Shell, aura::client::ActivationChangeObserver implementation:
1090 1101
1091 void Shell::OnWindowActivated(aura::Window* gained_active, 1102 void Shell::OnWindowActivated(aura::Window* gained_active,
1092 aura::Window* lost_active) { 1103 aura::Window* lost_active) {
1093 if (gained_active) 1104 if (gained_active)
1094 target_root_window_ = gained_active->GetRootWindow(); 1105 target_root_window_ = gained_active->GetRootWindow();
1095 } 1106 }
1096 1107
1097 } // namespace ash 1108 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698