| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ash/display/root_window_transformers.h" | 5 #include "ash/display/root_window_transformers.h" |
| 6 | 6 |
| 7 #include "ash/display/display_info.h" | 7 #include "ash/display/display_info.h" |
| 8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
| 9 #include "ash/magnifier/magnification_controller.h" | 9 #include "ash/magnifier/magnification_controller.h" |
| 10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
| 11 #include "ash/shelf/shelf.h" | 11 #include "ash/shelf/shelf.h" |
| 12 #include "ash/shelf/shelf_widget.h" | 12 #include "ash/shelf/shelf_widget.h" |
| 13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
| 14 #include "ash/test/ash_test_base.h" | 14 #include "ash/test/ash_test_base.h" |
| 15 #include "ash/test/cursor_manager_test_api.h" | 15 #include "ash/test/cursor_manager_test_api.h" |
| 16 #include "ash/test/mirror_window_test_api.h" | 16 #include "ash/test/mirror_window_test_api.h" |
| 17 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
| 18 #include "ui/aura/env.h" | 18 #include "ui/aura/env.h" |
| 19 #include "ui/aura/root_window_transformer.h" | 19 #include "ui/aura/root_window_transformer.h" |
| 20 #include "ui/aura/test/event_generator.h" | 20 #include "ui/aura/test/event_generator.h" |
| 21 #include "ui/aura/window_event_dispatcher.h" | 21 #include "ui/aura/window_event_dispatcher.h" |
| 22 #include "ui/aura/window_tracker.h" | 22 #include "ui/aura/window_tracker.h" |
| 23 #include "ui/events/event_handler.h" | 23 #include "ui/events/event_handler.h" |
| 24 #include "ui/gfx/display.h" | 24 #include "ui/gfx/display.h" |
| 25 #include "ui/gfx/rect_conversions.h" | 25 #include "ui/gfx/rect_conversions.h" |
| 26 #include "ui/gfx/screen.h" | 26 #include "ui/gfx/screen.h" |
| 27 #include "ui/views/widget/widget.h" | 27 #include "ui/views/widget/widget.h" |
| 28 | 28 |
| 29 namespace ash { | 29 namespace ash { |
| 30 namespace internal { | |
| 31 | |
| 32 namespace { | 30 namespace { |
| 33 | 31 |
| 34 const char kDesktopBackgroundView[] = "DesktopBackgroundView"; | 32 const char kDesktopBackgroundView[] = "DesktopBackgroundView"; |
| 35 | 33 |
| 36 class TestEventHandler : public ui::EventHandler { | 34 class TestEventHandler : public ui::EventHandler { |
| 37 public: | 35 public: |
| 38 TestEventHandler() : target_root_(NULL), | 36 TestEventHandler() : target_root_(NULL), |
| 39 touch_radius_x_(0.0), | 37 touch_radius_x_(0.0), |
| 40 touch_radius_y_(0.0), | 38 touch_radius_y_(0.0), |
| 41 scroll_x_offset_(0.0), | 39 scroll_x_offset_(0.0), |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 test_api.CreateCurrentRootWindowTransformer()); | 401 test_api.CreateCurrentRootWindowTransformer()); |
| 404 // Y margin must be margin is (500 - 500/400 * 200) / 2 = 125. | 402 // Y margin must be margin is (500 - 500/400 * 200) / 2 = 125. |
| 405 EXPECT_EQ("0,125,0,125", transformer->GetHostInsets().ToString()); | 403 EXPECT_EQ("0,125,0,125", transformer->GetHostInsets().ToString()); |
| 406 | 404 |
| 407 UpdateDisplay("200x400,500x500"); | 405 UpdateDisplay("200x400,500x500"); |
| 408 // The aspect ratio is flipped, so X margin is now 125. | 406 // The aspect ratio is flipped, so X margin is now 125. |
| 409 transformer = test_api.CreateCurrentRootWindowTransformer(); | 407 transformer = test_api.CreateCurrentRootWindowTransformer(); |
| 410 EXPECT_EQ("125,0,125,0", transformer->GetHostInsets().ToString()); | 408 EXPECT_EQ("125,0,125,0", transformer->GetHostInsets().ToString()); |
| 411 } | 409 } |
| 412 | 410 |
| 413 } // namespace test | |
| 414 } // namespace ash | 411 } // namespace ash |
| OLD | NEW |