OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/launcher/launcher_tooltip_manager.h" | 5 #include "ash/launcher/launcher_tooltip_manager.h" |
6 | 6 |
7 #include "ash/launcher/launcher_view.h" | 7 #include "ash/launcher/launcher_view.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/window_animations.h" | 10 #include "ash/wm/window_animations.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 set_shadow(views::BubbleBorder::SMALL_SHADOW); | 94 set_shadow(views::BubbleBorder::SMALL_SHADOW); |
95 SetLayoutManager(new views::FillLayout()); | 95 SetLayoutManager(new views::FillLayout()); |
96 // The anchor may not have the widget in tests. | 96 // The anchor may not have the widget in tests. |
97 if (anchor->GetWidget() && anchor->GetWidget()->GetNativeView()) { | 97 if (anchor->GetWidget() && anchor->GetWidget()->GetNativeView()) { |
98 aura::RootWindow* root_window = | 98 aura::RootWindow* root_window = |
99 anchor->GetWidget()->GetNativeView()->GetRootWindow(); | 99 anchor->GetWidget()->GetNativeView()->GetRootWindow(); |
100 set_parent_window(ash::Shell::GetInstance()->GetContainer( | 100 set_parent_window(ash::Shell::GetInstance()->GetContainer( |
101 root_window, ash::internal::kShellWindowId_SettingBubbleContainer)); | 101 root_window, ash::internal::kShellWindowId_SettingBubbleContainer)); |
102 } | 102 } |
103 label_ = new views::Label; | 103 label_ = new views::Label; |
104 label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 104 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
105 label_->SetEnabledColor(kTooltipTextColor); | 105 label_->SetEnabledColor(kTooltipTextColor); |
106 label_->SetElideBehavior(views::Label::ELIDE_AT_END); | 106 label_->SetElideBehavior(views::Label::ELIDE_AT_END); |
107 AddChildView(label_); | 107 AddChildView(label_); |
108 views::BubbleDelegateView::CreateBubble(this); | 108 views::BubbleDelegateView::CreateBubble(this); |
109 } | 109 } |
110 | 110 |
111 void LauncherTooltipManager::LauncherTooltipBubble::SetText( | 111 void LauncherTooltipManager::LauncherTooltipBubble::SetText( |
112 const string16& text) { | 112 const string16& text) { |
113 label_->SetText(text); | 113 label_->SetText(text); |
114 SizeToContents(); | 114 SizeToContents(); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 view_->SetText(text_); | 369 view_->SetText(text_); |
370 | 370 |
371 gfx::NativeView native_view = widget_->GetNativeView(); | 371 gfx::NativeView native_view = widget_->GetNativeView(); |
372 SetWindowVisibilityAnimationType( | 372 SetWindowVisibilityAnimationType( |
373 native_view, WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); | 373 native_view, WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); |
374 SetWindowVisibilityAnimationTransition(native_view, ANIMATE_HIDE); | 374 SetWindowVisibilityAnimationTransition(native_view, ANIMATE_HIDE); |
375 } | 375 } |
376 | 376 |
377 } // namespace internal | 377 } // namespace internal |
378 } // namespace ash | 378 } // namespace ash |
OLD | NEW |