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

Side by Side Diff: ash/wm/workspace/workspace_layout_manager_unittest.cc

Issue 2241273004: Move kUseNewVKWindowBehavior switch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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
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/common/wm/workspace/workspace_layout_manager.h" 5 #include "ash/common/wm/workspace/workspace_layout_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/aura/wm_window_aura.h" 10 #include "ash/aura/wm_window_aura.h"
11 #include "ash/common/ash_switches.h"
12 #include "ash/common/session/session_state_delegate.h" 11 #include "ash/common/session/session_state_delegate.h"
13 #include "ash/common/shelf/shelf_constants.h" 12 #include "ash/common/shelf/shelf_constants.h"
14 #include "ash/common/shell_observer.h" 13 #include "ash/common/shell_observer.h"
15 #include "ash/common/shell_window_ids.h" 14 #include "ash/common/shell_window_ids.h"
16 #include "ash/common/wm/maximize_mode/workspace_backdrop_delegate.h" 15 #include "ash/common/wm/maximize_mode/workspace_backdrop_delegate.h"
17 #include "ash/common/wm/window_state.h" 16 #include "ash/common/wm/window_state.h"
18 #include "ash/common/wm/wm_event.h" 17 #include "ash/common/wm/wm_event.h"
19 #include "ash/common/wm/workspace/workspace_window_resizer.h" 18 #include "ash/common/wm/workspace/workspace_window_resizer.h"
20 #include "ash/common/wm_shell.h" 19 #include "ash/common/wm_shell.h"
21 #include "ash/display/display_manager.h" 20 #include "ash/display/display_manager.h"
22 #include "ash/root_window_controller.h" 21 #include "ash/root_window_controller.h"
23 #include "ash/screen_util.h" 22 #include "ash/screen_util.h"
24 #include "ash/shelf/shelf.h" 23 #include "ash/shelf/shelf.h"
25 #include "ash/shelf/shelf_layout_manager.h" 24 #include "ash/shelf/shelf_layout_manager.h"
26 #include "ash/shell.h" 25 #include "ash/shell.h"
27 #include "ash/test/ash_test_base.h" 26 #include "ash/test/ash_test_base.h"
28 #include "ash/test/display_manager_test_api.h" 27 #include "ash/test/display_manager_test_api.h"
29 #include "ash/wm/window_state_aura.h" 28 #include "ash/wm/window_state_aura.h"
30 #include "ash/wm/window_util.h" 29 #include "ash/wm/window_util.h"
31 #include "base/command_line.h" 30 #include "base/command_line.h"
32 #include "base/compiler_specific.h" 31 #include "base/compiler_specific.h"
33 #include "base/run_loop.h" 32 #include "base/run_loop.h"
34 #include "ui/aura/client/aura_constants.h" 33 #include "ui/aura/client/aura_constants.h"
35 #include "ui/aura/test/test_windows.h" 34 #include "ui/aura/test/test_windows.h"
36 #include "ui/aura/window.h" 35 #include "ui/aura/window.h"
37 #include "ui/aura/window_event_dispatcher.h" 36 #include "ui/aura/window_event_dispatcher.h"
37 #include "ui/base/ui_base_switches.h"
38 #include "ui/base/ui_base_types.h" 38 #include "ui/base/ui_base_types.h"
39 #include "ui/display/manager/display_layout.h" 39 #include "ui/display/manager/display_layout.h"
40 #include "ui/display/screen.h" 40 #include "ui/display/screen.h"
41 #include "ui/gfx/geometry/insets.h" 41 #include "ui/gfx/geometry/insets.h"
42 #include "ui/keyboard/keyboard_controller.h" 42 #include "ui/keyboard/keyboard_controller.h"
43 #include "ui/keyboard/keyboard_ui.h" 43 #include "ui/keyboard/keyboard_ui.h"
44 #include "ui/keyboard/keyboard_util.h" 44 #include "ui/keyboard/keyboard_util.h"
45 #include "ui/views/widget/widget.h" 45 #include "ui/views/widget/widget.h"
46 #include "ui/views/widget/widget_delegate.h" 46 #include "ui/views/widget/widget_delegate.h"
47 #include "ui/wm/core/window_util.h" 47 #include "ui/wm/core/window_util.h"
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 void InitKeyboardBounds() { 1096 void InitKeyboardBounds() {
1097 gfx::Rect work_area( 1097 gfx::Rect work_area(
1098 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); 1098 display::Screen::GetScreen()->GetPrimaryDisplay().work_area());
1099 keyboard_bounds_.SetRect(work_area.x(), 1099 keyboard_bounds_.SetRect(work_area.x(),
1100 work_area.y() + work_area.height() / 2, 1100 work_area.y() + work_area.height() / 2,
1101 work_area.width(), work_area.height() / 2); 1101 work_area.width(), work_area.height() / 2);
1102 } 1102 }
1103 1103
1104 void EnableNewVKMode() { 1104 void EnableNewVKMode() {
1105 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 1105 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
1106 if (!command_line->HasSwitch(switches::kAshUseNewVKWindowBehavior)) { 1106 if (!command_line->HasSwitch(::switches::kUseNewVKWindowBehavior)) {
sky 2016/08/19 03:05:36 no {} here.
hariank 2016/08/19 17:27:20 Done.
1107 command_line->AppendSwitch(switches::kAshUseNewVKWindowBehavior); 1107 command_line->AppendSwitch(::switches::kUseNewVKWindowBehavior);
1108 } 1108 }
1109 } 1109 }
1110 1110
1111 const gfx::Rect& keyboard_bounds() const { return keyboard_bounds_; } 1111 const gfx::Rect& keyboard_bounds() const { return keyboard_bounds_; }
1112 1112
1113 private: 1113 private:
1114 gfx::Insets restore_work_area_insets_; 1114 gfx::Insets restore_work_area_insets_;
1115 gfx::Rect keyboard_bounds_; 1115 gfx::Rect keyboard_bounds_;
1116 WorkspaceLayoutManager* layout_manager_; 1116 WorkspaceLayoutManager* layout_manager_;
1117 1117
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 changed_window_bounds.Offset(0, -shift); 1309 changed_window_bounds.Offset(0, -shift);
1310 // Window should be shifted up. 1310 // Window should be shifted up.
1311 EXPECT_EQ(changed_window_bounds, window->bounds()); 1311 EXPECT_EQ(changed_window_bounds, window->bounds());
1312 1312
1313 kb_controller->HideKeyboard( 1313 kb_controller->HideKeyboard(
1314 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC); 1314 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC);
1315 EXPECT_EQ(orig_window_bounds, window->bounds()); 1315 EXPECT_EQ(orig_window_bounds, window->bounds());
1316 } 1316 }
1317 1317
1318 } // namespace ash 1318 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698