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_layout_manager.h" | 7 #include "ash/shelf/shelf_layout_manager.h" |
8 #include "ash/shelf/shelf_view.h" | 8 #include "ash/shelf/shelf_view.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 views::View* anchor, | 73 views::View* anchor, |
74 views::BubbleBorder::Arrow arrow, | 74 views::BubbleBorder::Arrow arrow, |
75 ShelfTooltipManager* host) | 75 ShelfTooltipManager* host) |
76 : views::BubbleDelegateView(anchor, arrow), host_(host) { | 76 : views::BubbleDelegateView(anchor, arrow), host_(host) { |
77 // Make sure that the bubble follows the animation of the shelf. | 77 // Make sure that the bubble follows the animation of the shelf. |
78 set_move_with_anchor(true); | 78 set_move_with_anchor(true); |
79 gfx::Insets insets = gfx::Insets(kArrowOffsetTopBottom, | 79 gfx::Insets insets = gfx::Insets(kArrowOffsetTopBottom, |
80 kArrowOffsetLeftRight, | 80 kArrowOffsetLeftRight, |
81 kArrowOffsetTopBottom, | 81 kArrowOffsetTopBottom, |
82 kArrowOffsetLeftRight); | 82 kArrowOffsetLeftRight); |
83 // Launcher items can have an asymmetrical border for spacing reasons. | 83 // Shelf items can have an asymmetrical border for spacing reasons. |
84 // Adjust anchor location for this. | 84 // Adjust anchor location for this. |
85 if (anchor->border()) | 85 if (anchor->border()) |
86 insets += anchor->border()->GetInsets(); | 86 insets += anchor->border()->GetInsets(); |
87 | 87 |
88 set_anchor_view_insets(insets); | 88 set_anchor_view_insets(insets); |
89 set_close_on_esc(false); | 89 set_close_on_esc(false); |
90 set_close_on_deactivate(false); | 90 set_close_on_deactivate(false); |
91 set_use_focusless(true); | 91 set_use_focusless(true); |
92 set_accept_events(false); | 92 set_accept_events(false); |
93 set_margins(gfx::Insets(kTooltipTopBottomMargin, kTooltipLeftRightMargin, | 93 set_margins(gfx::Insets(kTooltipTopBottomMargin, kTooltipLeftRightMargin, |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 new base::OneShotTimer<ShelfTooltipManager>(); | 370 new base::OneShotTimer<ShelfTooltipManager>(); |
371 new_timer->Start(FROM_HERE, | 371 new_timer->Start(FROM_HERE, |
372 base::TimeDelta::FromMilliseconds(delay_in_ms), | 372 base::TimeDelta::FromMilliseconds(delay_in_ms), |
373 this, | 373 this, |
374 &ShelfTooltipManager::ShowInternal); | 374 &ShelfTooltipManager::ShowInternal); |
375 timer_.reset(new_timer); | 375 timer_.reset(new_timer); |
376 } | 376 } |
377 | 377 |
378 } // namespace internal | 378 } // namespace internal |
379 } // namespace ash | 379 } // namespace ash |
OLD | NEW |