OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/common/shelf/shelf_tooltip_manager.h" | 5 #include "ash/common/shelf/shelf_tooltip_manager.h" |
6 | 6 |
7 #include "ash/common/shelf/shelf_view.h" | 7 #include "ash/common/shelf/shelf_view.h" |
8 #include "ash/common/shelf/wm_shelf.h" | 8 #include "ash/common/shelf/wm_shelf.h" |
9 #include "ash/common/shell_window_ids.h" | 9 #include "ash/common/shell_window_ids.h" |
10 #include "ash/common/wm_lookup.h" | 10 #include "ash/common/wm_lookup.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 DISALLOW_COPY_AND_ASSIGN(ShelfTooltipBubble); | 114 DISALLOW_COPY_AND_ASSIGN(ShelfTooltipBubble); |
115 }; | 115 }; |
116 | 116 |
117 ShelfTooltipManager::ShelfTooltipManager(ShelfView* shelf_view) | 117 ShelfTooltipManager::ShelfTooltipManager(ShelfView* shelf_view) |
118 : timer_delay_(kTooltipAppearanceDelay), | 118 : timer_delay_(kTooltipAppearanceDelay), |
119 shelf_view_(shelf_view), | 119 shelf_view_(shelf_view), |
120 bubble_(nullptr), | 120 bubble_(nullptr), |
121 weak_factory_(this) { | 121 weak_factory_(this) { |
122 shelf_view_->wm_shelf()->AddObserver(this); | 122 shelf_view_->wm_shelf()->AddObserver(this); |
123 WmShell::Get()->AddPointerWatcher(this); | 123 const bool wants_moves = false; |
| 124 WmShell::Get()->AddPointerWatcher(this, wants_moves); |
124 } | 125 } |
125 | 126 |
126 ShelfTooltipManager::~ShelfTooltipManager() { | 127 ShelfTooltipManager::~ShelfTooltipManager() { |
127 WmShell::Get()->RemovePointerWatcher(this); | 128 WmShell::Get()->RemovePointerWatcher(this); |
128 shelf_view_->wm_shelf()->RemoveObserver(this); | 129 shelf_view_->wm_shelf()->RemoveObserver(this); |
129 WmWindow* window = nullptr; | 130 WmWindow* window = nullptr; |
130 if (shelf_view_->GetWidget()) | 131 if (shelf_view_->GetWidget()) |
131 window = WmLookup::Get()->GetWindowForWidget(shelf_view_->GetWidget()); | 132 window = WmLookup::Get()->GetWindowForWidget(shelf_view_->GetWidget()); |
132 if (window) | 133 if (window) |
133 window->RemoveLimitedPreTargetHandler(this); | 134 window->RemoveLimitedPreTargetHandler(this); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr())); | 248 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr())); |
248 } | 249 } |
249 } | 250 } |
250 | 251 |
251 bool ShelfTooltipManager::ShouldShowTooltipForView(views::View* view) { | 252 bool ShelfTooltipManager::ShouldShowTooltipForView(views::View* view) { |
252 return shelf_view_ && shelf_view_->ShouldShowTooltipForView(view) && | 253 return shelf_view_ && shelf_view_->ShouldShowTooltipForView(view) && |
253 shelf_view_->wm_shelf()->GetVisibilityState() == SHELF_VISIBLE; | 254 shelf_view_->wm_shelf()->GetVisibilityState() == SHELF_VISIBLE; |
254 } | 255 } |
255 | 256 |
256 } // namespace ash | 257 } // namespace ash |
OLD | NEW |