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/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "ui/views/controls/label.h" | 40 #include "ui/views/controls/label.h" |
41 #include "ui/views/layout/fill_layout.h" | 41 #include "ui/views/layout/fill_layout.h" |
42 #include "ui/views/view.h" | 42 #include "ui/views/view.h" |
43 #include "ui/views/widget/widget.h" | 43 #include "ui/views/widget/widget.h" |
44 | 44 |
45 #if defined(OS_WIN) | 45 #if defined(OS_WIN) |
46 #include "base/win/windows_version.h" | 46 #include "base/win/windows_version.h" |
47 #endif | 47 #endif |
48 | 48 |
49 namespace ash { | 49 namespace ash { |
50 namespace internal { | |
51 | |
52 namespace { | 50 namespace { |
53 | 51 |
54 void StepWidgetLayerAnimatorToEnd(views::Widget* widget) { | 52 void StepWidgetLayerAnimatorToEnd(views::Widget* widget) { |
55 gfx::AnimationContainerElement* element = | 53 gfx::AnimationContainerElement* element = |
56 static_cast<gfx::AnimationContainerElement*>( | 54 static_cast<gfx::AnimationContainerElement*>( |
57 widget->GetNativeView()->layer()->GetAnimator()); | 55 widget->GetNativeView()->layer()->GetAnimator()); |
58 element->Step(base::TimeTicks::Now() + base::TimeDelta::FromSeconds(1)); | 56 element->Step(base::TimeTicks::Now() + base::TimeDelta::FromSeconds(1)); |
59 } | 57 } |
60 | 58 |
61 ShelfWidget* GetShelfWidget() { | 59 ShelfWidget* GetShelfWidget() { |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 1006 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
1009 | 1007 |
1010 aura::Window* root = Shell::GetPrimaryRootWindow(); | 1008 aura::Window* root = Shell::GetPrimaryRootWindow(); |
1011 // LayoutShelf() forces the animation to completion, at which point the | 1009 // LayoutShelf() forces the animation to completion, at which point the |
1012 // shelf should go off the screen. | 1010 // shelf should go off the screen. |
1013 shelf->LayoutShelf(); | 1011 shelf->LayoutShelf(); |
1014 EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideSize, | 1012 EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideSize, |
1015 GetShelfWidget()->GetWindowBoundsInScreen().y()); | 1013 GetShelfWidget()->GetWindowBoundsInScreen().y()); |
1016 | 1014 |
1017 aura::Window* lock_container = Shell::GetContainer( | 1015 aura::Window* lock_container = Shell::GetContainer( |
1018 Shell::GetPrimaryRootWindow(), | 1016 Shell::GetPrimaryRootWindow(), kShellWindowId_LockScreenContainer); |
1019 internal::kShellWindowId_LockScreenContainer); | |
1020 | 1017 |
1021 views::Widget* lock_widget = new views::Widget; | 1018 views::Widget* lock_widget = new views::Widget; |
1022 views::Widget::InitParams lock_params( | 1019 views::Widget::InitParams lock_params( |
1023 views::Widget::InitParams::TYPE_WINDOW); | 1020 views::Widget::InitParams::TYPE_WINDOW); |
1024 lock_params.bounds = gfx::Rect(0, 0, 200, 200); | 1021 lock_params.bounds = gfx::Rect(0, 0, 200, 200); |
1025 params.context = CurrentContext(); | 1022 params.context = CurrentContext(); |
1026 lock_params.parent = lock_container; | 1023 lock_params.parent = lock_container; |
1027 // Widget is now owned by the parent window. | 1024 // Widget is now owned by the parent window. |
1028 lock_widget->Init(lock_params); | 1025 lock_widget->Init(lock_params); |
1029 lock_widget->Maximize(); | 1026 lock_widget->Maximize(); |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2049 // Test bottom left pixel for left alignment. | 2046 // Test bottom left pixel for left alignment. |
2050 generator.MoveMouseTo(0, 399); | 2047 generator.MoveMouseTo(0, 399); |
2051 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); | 2048 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); |
2052 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | 2049 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
2053 generator.ClickLeftButton(); | 2050 generator.ClickLeftButton(); |
2054 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); | 2051 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); |
2055 generator.ClickLeftButton(); | 2052 generator.ClickLeftButton(); |
2056 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | 2053 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
2057 } | 2054 } |
2058 | 2055 |
2059 } // namespace internal | |
2060 } // namespace ash | 2056 } // namespace ash |
OLD | NEW |