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

Unified Diff: ui/aura_shell/shell.cc

Issue 8747022: Aura: Tooltips (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed usage of window delegate. Created 9 years, 1 month 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
Index: ui/aura_shell/shell.cc
diff --git a/ui/aura_shell/shell.cc b/ui/aura_shell/shell.cc
index 49e515ffa687b32e8f8ebdd365e1b82c4434cc6e..f9bf23710b8c1519935ab0b014049a5511ba2c57 100644
--- a/ui/aura_shell/shell.cc
+++ b/ui/aura_shell/shell.cc
@@ -26,6 +26,7 @@
#include "ui/aura_shell/shell_accelerator_filter.h"
#include "ui/aura_shell/shell_delegate.h"
#include "ui/aura_shell/shell_factory.h"
+#include "ui/aura_shell/shell_tooltip_manager.h"
#include "ui/aura_shell/shell_window_ids.h"
#include "ui/aura_shell/stacking_controller.h"
#include "ui/aura_shell/toplevel_layout_manager.h"
@@ -113,6 +114,13 @@ Shell::Shell(ShellDelegate* delegate)
Shell::~Shell() {
RemoveDesktopEventFilter(accelerator_filter_.get());
+ // ShellTooltipManager needs a valid shell instance. We delete it before
+ // deleting the shell |instance_|.
+ RemoveDesktopEventFilter(tooltip_manager_.get());
+ aura::Desktop::GetInstance()->SetProperty(aura::kDesktopTooltipClientKey,
+ NULL);
+ tooltip_manager_.reset();
+
// Drag drop controller needs a valid shell instance. We destroy it first.
drag_drop_controller_.reset();
@@ -200,6 +208,12 @@ void Shell::Init() {
accelerator_filter_.reset(new internal::ShellAcceleratorFilter);
AddDesktopEventFilter(accelerator_filter_.get());
+ // Initialize ShellTooltipManager
+ tooltip_manager_.reset(new ShellTooltipManager);
+ aura::Desktop::GetInstance()->SetProperty(aura::kDesktopTooltipClientKey,
+ static_cast<aura::TooltipClient*>(tooltip_manager_.get()));
+ AddDesktopEventFilter(tooltip_manager_.get());
+
// Initialize drag drop controller.
drag_drop_controller_.reset(new internal::DragDropController);
aura::Desktop::GetInstance()->SetProperty(aura::kDesktopDragDropClientKey,

Powered by Google App Engine
This is Rietveld 408576698