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

Side by Side Diff: ash/common/shelf/shelf_tooltip_manager.cc

Issue 2235363003: Wires up WmShellMus::Add/RemovePointerWatcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pointer_watcher_capture
Patch Set: merge to tot again Created 4 years, 4 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/common/shelf/overflow_bubble.cc ('k') | ash/common/system/tray/tray_event_filter.cc » ('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 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
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
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
OLDNEW
« no previous file with comments | « ash/common/shelf/overflow_bubble.cc ('k') | ash/common/system/tray/tray_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698