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

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

Issue 1900443002: Removes aura dependencies from WindowPositioner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nuke GetWorkAreaForWindowInParent and fix windows Created 4 years, 8 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/rotator/screen_rotation_animator.cc ('k') | ash/shell.h » ('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/shelf/shelf_tooltip_manager.h" 5 #include "ash/shelf/shelf_tooltip_manager.h"
6 6
7 #include "ash/shelf/shelf.h" 7 #include "ash/shelf/shelf.h"
8 #include "ash/shelf/shelf_layout_manager.h" 8 #include "ash/shelf/shelf_layout_manager.h"
9 #include "ash/shelf/shelf_view.h" 9 #include "ash/shelf/shelf_view.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 views::View* ShelfTooltipManager::GetCurrentAnchorView() const { 132 views::View* ShelfTooltipManager::GetCurrentAnchorView() const {
133 return bubble_ ? bubble_->GetAnchorView() : nullptr; 133 return bubble_ ? bubble_->GetAnchorView() : nullptr;
134 } 134 }
135 135
136 void ShelfTooltipManager::ShowTooltip(views::View* view) { 136 void ShelfTooltipManager::ShowTooltip(views::View* view) {
137 timer_.Stop(); 137 timer_.Stop();
138 if (bubble_) { 138 if (bubble_) {
139 // Cancel the hiding animation to hide the old bubble immediately. 139 // Cancel the hiding animation to hide the old bubble immediately.
140 gfx::NativeView native_view = bubble_->GetWidget()->GetNativeView(); 140 gfx::NativeView native_view = bubble_->GetWidget()->GetNativeView();
141 wm::SetWindowVisibilityAnimationTransition(native_view, wm::ANIMATE_NONE); 141 ::wm::SetWindowVisibilityAnimationTransition(native_view,
142 ::wm::ANIMATE_NONE);
142 Close(); 143 Close();
143 } 144 }
144 145
145 if (shelf_layout_manager_ && !shelf_layout_manager_->IsVisible()) 146 if (shelf_layout_manager_ && !shelf_layout_manager_->IsVisible())
146 return; 147 return;
147 148
148 Shelf* shelf = shelf_view_->shelf(); 149 Shelf* shelf = shelf_view_->shelf();
149 views::BubbleBorder::Arrow arrow = shelf->SelectValueForShelfAlignment( 150 views::BubbleBorder::Arrow arrow = shelf->SelectValueForShelfAlignment(
150 views::BubbleBorder::BOTTOM_CENTER, views::BubbleBorder::LEFT_CENTER, 151 views::BubbleBorder::BOTTOM_CENTER, views::BubbleBorder::LEFT_CENTER,
151 views::BubbleBorder::RIGHT_CENTER); 152 views::BubbleBorder::RIGHT_CENTER);
152 153
153 base::string16 text = shelf_view_->GetTitleForView(view); 154 base::string16 text = shelf_view_->GetTitleForView(view);
154 bubble_ = new ShelfTooltipBubble(view, arrow, text); 155 bubble_ = new ShelfTooltipBubble(view, arrow, text);
155 gfx::NativeView native_view = bubble_->GetWidget()->GetNativeView(); 156 gfx::NativeView native_view = bubble_->GetWidget()->GetNativeView();
156 wm::SetWindowVisibilityAnimationType( 157 ::wm::SetWindowVisibilityAnimationType(
157 native_view, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); 158 native_view, ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL);
158 wm::SetWindowVisibilityAnimationTransition(native_view, wm::ANIMATE_HIDE); 159 ::wm::SetWindowVisibilityAnimationTransition(native_view, ::wm::ANIMATE_HIDE);
159 bubble_->GetWidget()->Show(); 160 bubble_->GetWidget()->Show();
160 } 161 }
161 162
162 void ShelfTooltipManager::ShowTooltipWithDelay(views::View* view) { 163 void ShelfTooltipManager::ShowTooltipWithDelay(views::View* view) {
163 if (!shelf_layout_manager_ || shelf_layout_manager_->IsVisible()) { 164 if (!shelf_layout_manager_ || shelf_layout_manager_->IsVisible()) {
164 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(timer_delay_), 165 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(timer_delay_),
165 base::Bind(&ShelfTooltipManager::ShowTooltip, 166 base::Bind(&ShelfTooltipManager::ShowTooltip,
166 weak_factory_.GetWeakPtr(), view)); 167 weak_factory_.GetWeakPtr(), view));
167 } 168 }
168 } 169 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // AutoHide state change happens during an event filter, so immediate close 221 // AutoHide state change happens during an event filter, so immediate close
221 // may cause a crash in the HandleMouseEvent() after the filter. So we just 222 // may cause a crash in the HandleMouseEvent() after the filter. So we just
222 // schedule the Close here. 223 // schedule the Close here.
223 base::ThreadTaskRunnerHandle::Get()->PostTask( 224 base::ThreadTaskRunnerHandle::Get()->PostTask(
224 FROM_HERE, 225 FROM_HERE,
225 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr())); 226 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr()));
226 } 227 }
227 } 228 }
228 229
229 } // namespace ash 230 } // namespace ash
OLDNEW
« no previous file with comments | « ash/rotator/screen_rotation_animator.cc ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698