| 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/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
| 6 #include "ash/shell.h" | 6 #include "ash/shell.h" |
| 7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
| 8 #include "ash/tooltips/tooltip_controller.h" | 8 #include "ash/tooltips/tooltip_controller.h" |
| 9 #include "ash/wm/cursor_manager.h" | 9 #include "ash/wm/cursor_manager.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 void AddViewToWidgetAndResize(views::Widget* widget, views::View* view) { | 65 void AddViewToWidgetAndResize(views::Widget* widget, views::View* view) { |
| 66 if (!widget->GetContentsView()) { | 66 if (!widget->GetContentsView()) { |
| 67 views::View* contents_view = new views::View; | 67 views::View* contents_view = new views::View; |
| 68 widget->SetContentsView(contents_view); | 68 widget->SetContentsView(contents_view); |
| 69 } | 69 } |
| 70 | 70 |
| 71 views::View* contents_view = widget->GetContentsView(); | 71 views::View* contents_view = widget->GetContentsView(); |
| 72 contents_view->AddChildView(view); | 72 contents_view->AddChildView(view); |
| 73 view->SetBounds(contents_view->width(), 0, 100, 100); | 73 view->SetBounds(contents_view->width(), 0, 100, 100); |
| 74 gfx::Rect contents_view_bounds = contents_view->bounds(); | 74 gfx::Rect contents_view_bounds = contents_view->bounds(); |
| 75 contents_view_bounds = contents_view_bounds.Union(view->bounds()); | 75 contents_view_bounds.Union(view->bounds()); |
| 76 contents_view->SetBoundsRect(contents_view_bounds); | 76 contents_view->SetBoundsRect(contents_view_bounds); |
| 77 widget->SetBounds(gfx::Rect(widget->GetWindowBoundsInScreen().origin(), | 77 widget->SetBounds(gfx::Rect(widget->GetWindowBoundsInScreen().origin(), |
| 78 contents_view_bounds.size())); | 78 contents_view_bounds.size())); |
| 79 } | 79 } |
| 80 | 80 |
| 81 ash::internal::TooltipController* GetController() { | 81 ash::internal::TooltipController* GetController() { |
| 82 return static_cast<ash::internal::TooltipController*>( | 82 return static_cast<ash::internal::TooltipController*>( |
| 83 aura::client::GetTooltipClient(Shell::GetPrimaryRootWindow())); | 83 aura::client::GetTooltipClient(Shell::GetPrimaryRootWindow())); |
| 84 } | 84 } |
| 85 | 85 |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 // be able to show tooltips on the primary display. | 512 // be able to show tooltips on the primary display. |
| 513 aura::test::EventGenerator generator1(root_windows[0]); | 513 aura::test::EventGenerator generator1(root_windows[0]); |
| 514 generator1.MoveMouseRelativeTo(widget1->GetNativeView(), | 514 generator1.MoveMouseRelativeTo(widget1->GetNativeView(), |
| 515 view1->bounds().CenterPoint()); | 515 view1->bounds().CenterPoint()); |
| 516 FireTooltipTimer(); | 516 FireTooltipTimer(); |
| 517 EXPECT_TRUE(IsTooltipVisible()); | 517 EXPECT_TRUE(IsTooltipVisible()); |
| 518 } | 518 } |
| 519 | 519 |
| 520 } // namespace test | 520 } // namespace test |
| 521 } // namespace ash | 521 } // namespace ash |
| OLD | NEW |