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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, |
94 kTooltipTopBottomMargin, kTooltipLeftRightMargin)); | 94 kTooltipTopBottomMargin, kTooltipLeftRightMargin)); |
95 set_shadow(views::BubbleBorder::SMALL_SHADOW); | 95 set_shadow(views::BubbleBorder::SMALL_SHADOW); |
96 SetLayoutManager(new views::FillLayout()); | 96 SetLayoutManager(new views::FillLayout()); |
97 // The anchor may not have the widget in tests. | 97 // The anchor may not have the widget in tests. |
98 if (anchor->GetWidget() && anchor->GetWidget()->GetNativeView()) { | 98 if (anchor->GetWidget() && anchor->GetWidget()->GetNativeView()) { |
99 aura::RootWindow* root_window = | 99 aura::Window* root_window = |
100 anchor->GetWidget()->GetNativeView()->GetRootWindow(); | 100 anchor->GetWidget()->GetNativeView()->GetRootWindow(); |
101 set_parent_window(ash::Shell::GetInstance()->GetContainer( | 101 set_parent_window(ash::Shell::GetInstance()->GetContainer( |
102 root_window, ash::internal::kShellWindowId_SettingBubbleContainer)); | 102 root_window, ash::internal::kShellWindowId_SettingBubbleContainer)); |
103 } | 103 } |
104 label_ = new views::Label; | 104 label_ = new views::Label; |
105 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 105 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
106 label_->SetEnabledColor(kTooltipTextColor); | 106 label_->SetEnabledColor(kTooltipTextColor); |
107 AddChildView(label_); | 107 AddChildView(label_); |
108 views::BubbleDelegateView::CreateBubble(this); | 108 views::BubbleDelegateView::CreateBubble(this); |
109 } | 109 } |
(...skipping 260 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 |