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

Side by Side Diff: ash/shell.cc

Issue 1782793002: Ash: Implement Toasts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed the comment Created 4 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
« no previous file with comments | « ash/shell.h ('k') | ash/system/toast/OWNER » ('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/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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "ash/shelf/shelf_layout_manager.h" 46 #include "ash/shelf/shelf_layout_manager.h"
47 #include "ash/shelf/shelf_model.h" 47 #include "ash/shelf/shelf_model.h"
48 #include "ash/shelf/shelf_widget.h" 48 #include "ash/shelf/shelf_widget.h"
49 #include "ash/shelf/shelf_window_watcher.h" 49 #include "ash/shelf/shelf_window_watcher.h"
50 #include "ash/shell_delegate.h" 50 #include "ash/shell_delegate.h"
51 #include "ash/shell_factory.h" 51 #include "ash/shell_factory.h"
52 #include "ash/shell_init_params.h" 52 #include "ash/shell_init_params.h"
53 #include "ash/shell_window_ids.h" 53 #include "ash/shell_window_ids.h"
54 #include "ash/system/locale/locale_notification_controller.h" 54 #include "ash/system/locale/locale_notification_controller.h"
55 #include "ash/system/status_area_widget.h" 55 #include "ash/system/status_area_widget.h"
56 #include "ash/system/toast/toast_manager.h"
56 #include "ash/system/tray/system_tray_delegate.h" 57 #include "ash/system/tray/system_tray_delegate.h"
57 #include "ash/system/tray/system_tray_notifier.h" 58 #include "ash/system/tray/system_tray_notifier.h"
58 #include "ash/utility/partial_screenshot_controller.h" 59 #include "ash/utility/partial_screenshot_controller.h"
59 #include "ash/wm/app_list_controller.h" 60 #include "ash/wm/app_list_controller.h"
60 #include "ash/wm/ash_focus_rules.h" 61 #include "ash/wm/ash_focus_rules.h"
61 #include "ash/wm/ash_native_cursor_manager.h" 62 #include "ash/wm/ash_native_cursor_manager.h"
62 #include "ash/wm/coordinate_conversion.h" 63 #include "ash/wm/coordinate_conversion.h"
63 #include "ash/wm/event_client_impl.h" 64 #include "ash/wm/event_client_impl.h"
64 #include "ash/wm/lock_state_controller.h" 65 #include "ash/wm/lock_state_controller.h"
65 #include "ash/wm/maximize_mode/maximize_mode_controller.h" 66 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 last_window_closed_logout_reminder_.reset(); 726 last_window_closed_logout_reminder_.reset();
726 727
727 // Destroy the LogoutConfirmationController before the SystemTrayDelegate. 728 // Destroy the LogoutConfirmationController before the SystemTrayDelegate.
728 logout_confirmation_controller_.reset(); 729 logout_confirmation_controller_.reset();
729 #endif 730 #endif
730 731
731 // Destroy the keyboard before closing the shelf, since it will invoke a shelf 732 // Destroy the keyboard before closing the shelf, since it will invoke a shelf
732 // layout. 733 // layout.
733 DeactivateKeyboard(); 734 DeactivateKeyboard();
734 735
736 // Destroy toasts
737 toast_manager_.reset();
738
735 // Destroy SystemTrayDelegate before destroying the status area(s). Make sure 739 // Destroy SystemTrayDelegate before destroying the status area(s). Make sure
736 // to deinitialize the shelf first, as it is initialized after the delegate. 740 // to deinitialize the shelf first, as it is initialized after the delegate.
737 HideShelf(); 741 HideShelf();
738 system_tray_delegate_->Shutdown(); 742 system_tray_delegate_->Shutdown();
739 system_tray_delegate_.reset(); 743 system_tray_delegate_.reset();
740 744
741 locale_notification_controller_.reset(); 745 locale_notification_controller_.reset();
742 746
743 // Drag-and-drop must be canceled prior to close all windows. 747 // Drag-and-drop must be canceled prior to close all windows.
744 drag_drop_controller_.reset(); 748 drag_drop_controller_.reset();
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 1054
1051 // Initialize system_tray_delegate_ before initializing StatusAreaWidget. 1055 // Initialize system_tray_delegate_ before initializing StatusAreaWidget.
1052 system_tray_delegate_.reset(delegate()->CreateSystemTrayDelegate()); 1056 system_tray_delegate_.reset(delegate()->CreateSystemTrayDelegate());
1053 DCHECK(system_tray_delegate_.get()); 1057 DCHECK(system_tray_delegate_.get());
1054 1058
1055 locale_notification_controller_.reset(new LocaleNotificationController); 1059 locale_notification_controller_.reset(new LocaleNotificationController);
1056 1060
1057 // Initialize system_tray_delegate_ after StatusAreaWidget is created. 1061 // Initialize system_tray_delegate_ after StatusAreaWidget is created.
1058 system_tray_delegate_->Initialize(); 1062 system_tray_delegate_->Initialize();
1059 1063
1064 // Initialize toast manager
1065 toast_manager_.reset(new ToastManager);
1066
1060 #if defined(OS_CHROMEOS) 1067 #if defined(OS_CHROMEOS)
1061 // Create the LogoutConfirmationController after the SystemTrayDelegate. 1068 // Create the LogoutConfirmationController after the SystemTrayDelegate.
1062 logout_confirmation_controller_.reset(new LogoutConfirmationController( 1069 logout_confirmation_controller_.reset(new LogoutConfirmationController(
1063 base::Bind(&SystemTrayDelegate::SignOut, 1070 base::Bind(&SystemTrayDelegate::SignOut,
1064 base::Unretained(system_tray_delegate_.get())))); 1071 base::Unretained(system_tray_delegate_.get()))));
1065 1072
1066 // Create TouchTransformerController before 1073 // Create TouchTransformerController before
1067 // WindowTreeHostManager::InitDisplays() 1074 // WindowTreeHostManager::InitDisplays()
1068 // since TouchTransformerController listens on 1075 // since TouchTransformerController listens on
1069 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). 1076 // WindowTreeHostManager::Observer::OnDisplaysInitialized().
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 1211
1205 void Shell::OnWindowActivated( 1212 void Shell::OnWindowActivated(
1206 aura::client::ActivationChangeObserver::ActivationReason reason, 1213 aura::client::ActivationChangeObserver::ActivationReason reason,
1207 aura::Window* gained_active, 1214 aura::Window* gained_active,
1208 aura::Window* lost_active) { 1215 aura::Window* lost_active) {
1209 if (gained_active) 1216 if (gained_active)
1210 target_root_window_ = gained_active->GetRootWindow(); 1217 target_root_window_ = gained_active->GetRootWindow();
1211 } 1218 }
1212 1219
1213 } // namespace ash 1220 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/system/toast/OWNER » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698