| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/system/web_notification/ash_popup_alignment_delegate.h" | 5 #include "ash/system/web_notification/ash_popup_alignment_delegate.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
| 11 #include "ash/common/wm/wm_globals.h" | 11 #include "ash/common/wm_root_window_controller.h" |
| 12 #include "ash/common/wm/wm_root_window_controller.h" | 12 #include "ash/common/wm_shell.h" |
| 13 #include "ash/common/wm/wm_window.h" | 13 #include "ash/common/wm_window.h" |
| 14 #include "ash/display/display_manager.h" | 14 #include "ash/display/display_manager.h" |
| 15 #include "ash/screen_util.h" | 15 #include "ash/screen_util.h" |
| 16 #include "ash/shelf/shelf.h" | 16 #include "ash/shelf/shelf.h" |
| 17 #include "ash/shelf/shelf_layout_manager.h" | 17 #include "ash/shelf/shelf_layout_manager.h" |
| 18 #include "ash/shelf/shelf_types.h" | 18 #include "ash/shelf/shelf_types.h" |
| 19 #include "ash/shell.h" | 19 #include "ash/shell.h" |
| 20 #include "ash/test/ash_test_base.h" | 20 #include "ash/test/ash_test_base.h" |
| 21 #include "base/command_line.h" | 21 #include "base/command_line.h" |
| 22 #include "base/memory/ptr_util.h" | 22 #include "base/memory/ptr_util.h" |
| 23 #include "ui/display/screen.h" | 23 #include "ui/display/screen.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 gfx::Rect GetWorkArea() { | 101 gfx::Rect GetWorkArea() { |
| 102 return alignment_delegate_->work_area_; | 102 return alignment_delegate_->work_area_; |
| 103 } | 103 } |
| 104 | 104 |
| 105 std::unique_ptr<views::Widget> CreateTestWidget(int container_id) { | 105 std::unique_ptr<views::Widget> CreateTestWidget(int container_id) { |
| 106 std::unique_ptr<views::Widget> widget(new views::Widget); | 106 std::unique_ptr<views::Widget> widget(new views::Widget); |
| 107 views::Widget::InitParams params; | 107 views::Widget::InitParams params; |
| 108 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 108 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 109 params.bounds = gfx::Rect(0, 0, 50, 50); | 109 params.bounds = gfx::Rect(0, 0, 50, 50); |
| 110 wm::WmGlobals::Get() | 110 WmShell::Get() |
| 111 ->GetPrimaryRootWindow() | 111 ->GetPrimaryRootWindow() |
| 112 ->GetRootWindowController() | 112 ->GetRootWindowController() |
| 113 ->ConfigureWidgetInitParamsForContainer(widget.get(), container_id, | 113 ->ConfigureWidgetInitParamsForContainer(widget.get(), container_id, |
| 114 ¶ms); | 114 ¶ms); |
| 115 widget->Init(params); | 115 widget->Init(params); |
| 116 widget->Show(); | 116 widget->Show(); |
| 117 return widget; | 117 return widget; |
| 118 } | 118 } |
| 119 | 119 |
| 120 private: | 120 private: |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 SetKeyboardBounds(keyboard_bounds); | 329 SetKeyboardBounds(keyboard_bounds); |
| 330 int keyboard_baseline = alignment_delegate()->GetBaseLine(); | 330 int keyboard_baseline = alignment_delegate()->GetBaseLine(); |
| 331 EXPECT_NE(baseline, keyboard_baseline); | 331 EXPECT_NE(baseline, keyboard_baseline); |
| 332 EXPECT_GT(keyboard_bounds.y(), keyboard_baseline); | 332 EXPECT_GT(keyboard_bounds.y(), keyboard_baseline); |
| 333 | 333 |
| 334 SetKeyboardBounds(gfx::Rect()); | 334 SetKeyboardBounds(gfx::Rect()); |
| 335 EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine()); | 335 EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine()); |
| 336 } | 336 } |
| 337 | 337 |
| 338 } // namespace ash | 338 } // namespace ash |
| OLD | NEW |