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

Unified Diff: ash/shell.cc

Issue 9535025: Remove the singleton instance get/delete methods from RootWindow (yay) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell.h ('k') | ash/shell/shell_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
===================================================================
--- ash/shell.cc (revision 124527)
+++ ash/shell.cc (working copy)
@@ -270,11 +270,7 @@
// Shell, public:
Shell::Shell(ShellDelegate* delegate)
- : root_filter_(new internal::RootWindowEventFilter),
-#if !defined(OS_MACOSX)
- nested_dispatcher_controller_(new NestedDispatcherController),
- accelerator_controller_(new AcceleratorController),
-#endif
+ : root_window_(new aura::RootWindow),
delegate_(delegate),
audio_controller_(NULL),
brightness_controller_(NULL),
@@ -283,8 +279,6 @@
desktop_background_mode_(BACKGROUND_IMAGE),
root_window_layout_(NULL),
status_widget_(NULL) {
- // Pass ownership of the filter to the root window.
- GetRootWindow()->SetEventFilter(root_filter_);
}
Shell::~Shell() {
@@ -320,7 +314,10 @@
// These need a valid Shell instance to clean up properly, so explicitly
// delete them before invalidating the instance.
+ // Alphabetical.
+ activation_controller_.reset();
drag_drop_controller_.reset();
+ shadow_controller_.reset();
window_cycle_controller_.reset();
// Launcher widget has a InputMethodBridge that references to
@@ -356,10 +353,18 @@
// static
aura::RootWindow* Shell::GetRootWindow() {
- return aura::RootWindow::GetInstance();
+ return GetInstance()->root_window_.get();
}
void Shell::Init() {
+ root_filter_ = new internal::RootWindowEventFilter;
+#if !defined(OS_MACOSX)
+ nested_dispatcher_controller_.reset(new NestedDispatcherController);
+ accelerator_controller_.reset(new AcceleratorController);
+#endif
+ // Pass ownership of the filter to the root window.
+ GetRootWindow()->SetEventFilter(root_filter_);
+
DCHECK(!GetRootWindowEventFilterCount());
// PartialScreenshotEventFilter must be the first one to capture key
« no previous file with comments | « ash/shell.h ('k') | ash/shell/shell_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698