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

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

Issue 2271393002: Wires up drags to pointer watcher adapter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Rebased. Created 4 years, 3 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
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 const bool wants_moves = false; 123 WmShell::Get()->AddPointerWatcher(this,
124 WmShell::Get()->AddPointerWatcher(this, wants_moves); 124 views::PointerWatcherEventTypes::BASIC);
125 } 125 }
126 126
127 ShelfTooltipManager::~ShelfTooltipManager() { 127 ShelfTooltipManager::~ShelfTooltipManager() {
128 WmShell::Get()->RemovePointerWatcher(this); 128 WmShell::Get()->RemovePointerWatcher(this);
129 shelf_view_->wm_shelf()->RemoveObserver(this); 129 shelf_view_->wm_shelf()->RemoveObserver(this);
130 WmWindow* window = nullptr; 130 WmWindow* window = nullptr;
131 if (shelf_view_->GetWidget()) 131 if (shelf_view_->GetWidget())
132 window = WmLookup::Get()->GetWindowForWidget(shelf_view_->GetWidget()); 132 window = WmLookup::Get()->GetWindowForWidget(shelf_view_->GetWidget());
133 if (window) 133 if (window)
134 window->RemoveLimitedPreTargetHandler(this); 134 window->RemoveLimitedPreTargetHandler(this);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr())); 248 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr()));
249 } 249 }
250 } 250 }
251 251
252 bool ShelfTooltipManager::ShouldShowTooltipForView(views::View* view) { 252 bool ShelfTooltipManager::ShouldShowTooltipForView(views::View* view) {
253 return shelf_view_ && shelf_view_->ShouldShowTooltipForView(view) && 253 return shelf_view_ && shelf_view_->ShouldShowTooltipForView(view) &&
254 shelf_view_->wm_shelf()->GetVisibilityState() == SHELF_VISIBLE; 254 shelf_view_->wm_shelf()->GetVisibilityState() == SHELF_VISIBLE;
255 } 255 }
256 256
257 } // namespace ash 257 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698