Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1655)

Side by Side Diff: ash/test/ash_test_base.cc

Issue 2542493002: Replace kCanMaximize/Minimize/Resize with kResizeBehavior. (Closed)
Patch Set: Fix int->bool compile issue. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/test/BUILD.gn ('k') | ash/wm/ash_focus_rules_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/test/ash_test_base.h" 5 #include "ash/test/ash_test_base.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/test/test_session_state_delegate.h" 10 #include "ash/common/test/test_session_state_delegate.h"
11 #include "ash/common/test/test_system_tray_delegate.h" 11 #include "ash/common/test/test_system_tray_delegate.h"
12 #include "ash/common/wm/window_positioner.h" 12 #include "ash/common/wm/window_positioner.h"
13 #include "ash/common/wm_root_window_controller.h" 13 #include "ash/common/wm_root_window_controller.h"
14 #include "ash/common/wm_shell.h" 14 #include "ash/common/wm_shell.h"
15 #include "ash/common/wm_window.h" 15 #include "ash/common/wm_window.h"
16 #include "ash/display/extended_mouse_warp_controller.h" 16 #include "ash/display/extended_mouse_warp_controller.h"
17 #include "ash/display/mouse_cursor_event_filter.h" 17 #include "ash/display/mouse_cursor_event_filter.h"
18 #include "ash/display/unified_mouse_warp_controller.h" 18 #include "ash/display/unified_mouse_warp_controller.h"
19 #include "ash/display/window_tree_host_manager.h" 19 #include "ash/display/window_tree_host_manager.h"
20 #include "ash/ime/input_method_event_handler.h" 20 #include "ash/ime/input_method_event_handler.h"
21 #include "ash/shell.h" 21 #include "ash/shell.h"
22 #include "ash/shell/toplevel_window.h" 22 #include "ash/shell/toplevel_window.h"
23 #include "ash/test/ash_test_environment.h" 23 #include "ash/test/ash_test_environment.h"
24 #include "ash/test/ash_test_helper.h" 24 #include "ash/test/ash_test_helper.h"
25 #include "ash/test/test_shell_delegate.h" 25 #include "ash/test/test_shell_delegate.h"
26 #include "base/command_line.h" 26 #include "base/command_line.h"
27 #include "services/ui/public/interfaces/window_manager_constants.mojom.h"
27 #include "ui/aura/client/aura_constants.h" 28 #include "ui/aura/client/aura_constants.h"
28 #include "ui/aura/client/screen_position_client.h" 29 #include "ui/aura/client/screen_position_client.h"
29 #include "ui/aura/client/window_parenting_client.h" 30 #include "ui/aura/client/window_parenting_client.h"
30 #include "ui/aura/env.h" 31 #include "ui/aura/env.h"
31 #include "ui/aura/test/event_generator_delegate_aura.h" 32 #include "ui/aura/test/event_generator_delegate_aura.h"
32 #include "ui/aura/test/test_window_delegate.h" 33 #include "ui/aura/test/test_window_delegate.h"
33 #include "ui/aura/window.h" 34 #include "ui/aura/window.h"
34 #include "ui/aura/window_delegate.h" 35 #include "ui/aura/window_delegate.h"
35 #include "ui/aura/window_tree_host.h" 36 #include "ui/aura/window_tree_host.h"
36 #include "ui/base/ime/input_method_initializer.h" 37 #include "ui/base/ime/input_method_initializer.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 display::Display display = 284 display::Display display =
284 display::Screen::GetScreen()->GetDisplayMatching(bounds); 285 display::Screen::GetScreen()->GetDisplayMatching(bounds);
285 aura::Window* root = Shell::GetInstance() 286 aura::Window* root = Shell::GetInstance()
286 ->window_tree_host_manager() 287 ->window_tree_host_manager()
287 ->GetRootWindowForDisplayId(display.id()); 288 ->GetRootWindowForDisplayId(display.id());
288 gfx::Point origin = bounds.origin(); 289 gfx::Point origin = bounds.origin();
289 ::wm::ConvertPointFromScreen(root, &origin); 290 ::wm::ConvertPointFromScreen(root, &origin);
290 window->SetBounds(gfx::Rect(origin, bounds.size())); 291 window->SetBounds(gfx::Rect(origin, bounds.size()));
291 aura::client::ParentWindowWithContext(window, root, bounds); 292 aura::client::ParentWindowWithContext(window, root, bounds);
292 } 293 }
293 window->SetProperty(aura::client::kCanMaximizeKey, true); 294 window->SetProperty(aura::client::kResizeBehaviorKey,
294 window->SetProperty(aura::client::kCanMinimizeKey, true); 295 ui::mojom::kResizeBehaviorCanMaximize |
296 ui::mojom::kResizeBehaviorCanMinimize |
297 ui::mojom::kResizeBehaviorCanResize);
298
295 return window; 299 return window;
296 } 300 }
297 301
298 void AshTestBase::ParentWindowInPrimaryRootWindow(aura::Window* window) { 302 void AshTestBase::ParentWindowInPrimaryRootWindow(aura::Window* window) {
299 aura::client::ParentWindowWithContext(window, Shell::GetPrimaryRootWindow(), 303 aura::client::ParentWindowWithContext(window, Shell::GetPrimaryRootWindow(),
300 gfx::Rect()); 304 gfx::Rect());
301 } 305 }
302 306
303 void AshTestBase::RunAllPendingInMessageLoop() { 307 void AshTestBase::RunAllPendingInMessageLoop() {
304 ash_test_helper_->RunAllPendingInMessageLoop(); 308 ash_test_helper_->RunAllPendingInMessageLoop();
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 402
399 void AshTestBase::SwapPrimaryDisplay() { 403 void AshTestBase::SwapPrimaryDisplay() {
400 if (display::Screen::GetScreen()->GetNumDisplays() <= 1) 404 if (display::Screen::GetScreen()->GetNumDisplays() <= 1)
401 return; 405 return;
402 Shell::GetInstance()->window_tree_host_manager()->SetPrimaryDisplayId( 406 Shell::GetInstance()->window_tree_host_manager()->SetPrimaryDisplayId(
403 display_manager()->GetSecondaryDisplay().id()); 407 display_manager()->GetSecondaryDisplay().id());
404 } 408 }
405 409
406 } // namespace test 410 } // namespace test
407 } // namespace ash 411 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/BUILD.gn ('k') | ash/wm/ash_focus_rules_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698