OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/browser/web_contents/aura/window_slider.h" | 5 #include "content/browser/web_contents/aura/window_slider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/aura/test/aura_test_base.h" | 10 #include "ui/aura/test/aura_test_base.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 CHECK(!details.dispatcher_destroyed); | 31 CHECK(!details.dispatcher_destroyed); |
32 } | 32 } |
33 | 33 |
34 void ChangeSliderOwnerDuringScrollCallback(scoped_ptr<aura::Window>* window, | 34 void ChangeSliderOwnerDuringScrollCallback(scoped_ptr<aura::Window>* window, |
35 WindowSlider* slider, | 35 WindowSlider* slider, |
36 ui::EventType type, | 36 ui::EventType type, |
37 const gfx::Vector2dF& delta) { | 37 const gfx::Vector2dF& delta) { |
38 if (type != ui::ET_GESTURE_SCROLL_UPDATE) | 38 if (type != ui::ET_GESTURE_SCROLL_UPDATE) |
39 return; | 39 return; |
40 aura::Window* new_window = new aura::Window(NULL); | 40 aura::Window* new_window = new aura::Window(NULL); |
41 new_window->Init(aura::WINDOW_LAYER_TEXTURED); | 41 new_window->Init(ui::LAYER_TEXTURED); |
42 new_window->Show(); | 42 new_window->Show(); |
43 slider->ChangeOwner(new_window); | 43 slider->ChangeOwner(new_window); |
44 (*window)->parent()->AddChild(new_window); | 44 (*window)->parent()->AddChild(new_window); |
45 window->reset(new_window); | 45 window->reset(new_window); |
46 } | 46 } |
47 | 47 |
48 void ConfirmSlideDuringScrollCallback(WindowSlider* slider, | 48 void ConfirmSlideDuringScrollCallback(WindowSlider* slider, |
49 ui::EventType type, | 49 ui::EventType type, |
50 const gfx::Vector2dF& delta) { | 50 const gfx::Vector2dF& delta) { |
51 static float total_delta_x = 0; | 51 static float total_delta_x = 0; |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 animator->Step(start_time2 + duration); | 630 animator->Step(start_time2 + duration); |
631 // The animation for the second slide should now be completed. | 631 // The animation for the second slide should now be completed. |
632 EXPECT_TRUE(slider_delegate.slide_completed()); | 632 EXPECT_TRUE(slider_delegate.slide_completed()); |
633 slider_delegate.Reset(); | 633 slider_delegate.Reset(); |
634 | 634 |
635 window.reset(); | 635 window.reset(); |
636 EXPECT_TRUE(slider_delegate.slider_destroyed()); | 636 EXPECT_TRUE(slider_delegate.slider_destroyed()); |
637 } | 637 } |
638 | 638 |
639 } // namespace content | 639 } // namespace content |
OLD | NEW |