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/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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 wm::SetWindowVisibilityAnimationTransition(native_view, wm::ANIMATE_NONE); | 140 wm::SetWindowVisibilityAnimationTransition(native_view, wm::ANIMATE_NONE); |
141 Close(); | 141 Close(); |
142 } | 142 } |
143 | 143 |
144 if (shelf_layout_manager_ && !shelf_layout_manager_->IsVisible()) | 144 if (shelf_layout_manager_ && !shelf_layout_manager_->IsVisible()) |
145 return; | 145 return; |
146 | 146 |
147 Shelf* shelf = shelf_view_->shelf(); | 147 Shelf* shelf = shelf_view_->shelf(); |
148 views::BubbleBorder::Arrow arrow = shelf->SelectValueForShelfAlignment( | 148 views::BubbleBorder::Arrow arrow = shelf->SelectValueForShelfAlignment( |
149 views::BubbleBorder::BOTTOM_CENTER, views::BubbleBorder::LEFT_CENTER, | 149 views::BubbleBorder::BOTTOM_CENTER, views::BubbleBorder::LEFT_CENTER, |
150 views::BubbleBorder::RIGHT_CENTER, views::BubbleBorder::TOP_CENTER); | 150 views::BubbleBorder::RIGHT_CENTER); |
151 | 151 |
152 base::string16 text = shelf_view_->GetTitleForView(view); | 152 base::string16 text = shelf_view_->GetTitleForView(view); |
153 bubble_ = new ShelfTooltipBubble(view, arrow, text); | 153 bubble_ = new ShelfTooltipBubble(view, arrow, text); |
154 gfx::NativeView native_view = bubble_->GetWidget()->GetNativeView(); | 154 gfx::NativeView native_view = bubble_->GetWidget()->GetNativeView(); |
155 wm::SetWindowVisibilityAnimationType( | 155 wm::SetWindowVisibilityAnimationType( |
156 native_view, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); | 156 native_view, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); |
157 wm::SetWindowVisibilityAnimationTransition(native_view, wm::ANIMATE_HIDE); | 157 wm::SetWindowVisibilityAnimationTransition(native_view, wm::ANIMATE_HIDE); |
158 bubble_->GetWidget()->Show(); | 158 bubble_->GetWidget()->Show(); |
159 } | 159 } |
160 | 160 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // AutoHide state change happens during an event filter, so immediate close | 219 // AutoHide state change happens during an event filter, so immediate close |
220 // may cause a crash in the HandleMouseEvent() after the filter. So we just | 220 // may cause a crash in the HandleMouseEvent() after the filter. So we just |
221 // schedule the Close here. | 221 // schedule the Close here. |
222 base::ThreadTaskRunnerHandle::Get()->PostTask( | 222 base::ThreadTaskRunnerHandle::Get()->PostTask( |
223 FROM_HERE, | 223 FROM_HERE, |
224 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr())); | 224 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr())); |
225 } | 225 } |
226 } | 226 } |
227 | 227 |
228 } // namespace ash | 228 } // namespace ash |
OLD | NEW |