| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 kArrowOffsetTopBottom, | 78 kArrowOffsetTopBottom, |
| 79 kArrowOffsetLeftRight); | 79 kArrowOffsetLeftRight); |
| 80 // Shelf items can have an asymmetrical border for spacing reasons. | 80 // Shelf items can have an asymmetrical border for spacing reasons. |
| 81 // Adjust anchor location for this. | 81 // Adjust anchor location for this. |
| 82 if (anchor->border()) | 82 if (anchor->border()) |
| 83 insets += anchor->border()->GetInsets(); | 83 insets += anchor->border()->GetInsets(); |
| 84 | 84 |
| 85 set_anchor_view_insets(insets); | 85 set_anchor_view_insets(insets); |
| 86 set_close_on_esc(false); | 86 set_close_on_esc(false); |
| 87 set_close_on_deactivate(false); | 87 set_close_on_deactivate(false); |
| 88 set_use_focusless(true); | 88 set_can_activate(false); |
| 89 set_accept_events(false); | 89 set_accept_events(false); |
| 90 set_margins(gfx::Insets(kTooltipTopBottomMargin, kTooltipLeftRightMargin, | 90 set_margins(gfx::Insets(kTooltipTopBottomMargin, kTooltipLeftRightMargin, |
| 91 kTooltipTopBottomMargin, kTooltipLeftRightMargin)); | 91 kTooltipTopBottomMargin, kTooltipLeftRightMargin)); |
| 92 set_shadow(views::BubbleBorder::SMALL_SHADOW); | 92 set_shadow(views::BubbleBorder::SMALL_SHADOW); |
| 93 SetLayoutManager(new views::FillLayout()); | 93 SetLayoutManager(new views::FillLayout()); |
| 94 // The anchor may not have the widget in tests. | 94 // The anchor may not have the widget in tests. |
| 95 if (anchor->GetWidget() && anchor->GetWidget()->GetNativeView()) { | 95 if (anchor->GetWidget() && anchor->GetWidget()->GetNativeView()) { |
| 96 aura::Window* root_window = | 96 aura::Window* root_window = |
| 97 anchor->GetWidget()->GetNativeView()->GetRootWindow(); | 97 anchor->GetWidget()->GetNativeView()->GetRootWindow(); |
| 98 set_parent_window(ash::Shell::GetInstance()->GetContainer( | 98 set_parent_window(ash::Shell::GetInstance()->GetContainer( |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 base::OneShotTimer<ShelfTooltipManager>* new_timer = | 366 base::OneShotTimer<ShelfTooltipManager>* new_timer = |
| 367 new base::OneShotTimer<ShelfTooltipManager>(); | 367 new base::OneShotTimer<ShelfTooltipManager>(); |
| 368 new_timer->Start(FROM_HERE, | 368 new_timer->Start(FROM_HERE, |
| 369 base::TimeDelta::FromMilliseconds(delay_in_ms), | 369 base::TimeDelta::FromMilliseconds(delay_in_ms), |
| 370 this, | 370 this, |
| 371 &ShelfTooltipManager::ShowInternal); | 371 &ShelfTooltipManager::ShowInternal); |
| 372 timer_.reset(new_timer); | 372 timer_.reset(new_timer); |
| 373 } | 373 } |
| 374 | 374 |
| 375 } // namespace ash | 375 } // namespace ash |
| OLD | NEW |