| 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/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(gfx::ALIGN_LEFT); | 104 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 105 label_->SetEnabledColor(kTooltipTextColor); | 105 label_->SetEnabledColor(kTooltipTextColor); |
| 106 label_->SetElideBehavior(views::Label::ELIDE_AT_END); | |
| 107 AddChildView(label_); | 106 AddChildView(label_); |
| 108 views::BubbleDelegateView::CreateBubble(this); | 107 views::BubbleDelegateView::CreateBubble(this); |
| 109 } | 108 } |
| 110 | 109 |
| 111 void LauncherTooltipManager::LauncherTooltipBubble::SetText( | 110 void LauncherTooltipManager::LauncherTooltipBubble::SetText( |
| 112 const base::string16& text) { | 111 const base::string16& text) { |
| 113 label_->SetText(text); | 112 label_->SetText(text); |
| 114 SizeToContents(); | 113 SizeToContents(); |
| 115 } | 114 } |
| 116 | 115 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 362 |
| 364 gfx::NativeView native_view = widget_->GetNativeView(); | 363 gfx::NativeView native_view = widget_->GetNativeView(); |
| 365 views::corewm::SetWindowVisibilityAnimationType( | 364 views::corewm::SetWindowVisibilityAnimationType( |
| 366 native_view, views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); | 365 native_view, views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); |
| 367 views::corewm::SetWindowVisibilityAnimationTransition( | 366 views::corewm::SetWindowVisibilityAnimationTransition( |
| 368 native_view, views::corewm::ANIMATE_HIDE); | 367 native_view, views::corewm::ANIMATE_HIDE); |
| 369 } | 368 } |
| 370 | 369 |
| 371 } // namespace internal | 370 } // namespace internal |
| 372 } // namespace ash | 371 } // namespace ash |
| OLD | NEW |