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

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

Issue 2350953009: Centralizes more shared code between ash and mash (Closed)
Patch Set: feedback Created 4 years, 3 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
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/wm/always_on_top_controller_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/display_manager_test_api.h" 5 #include "ash/test/display_manager_test_api.h"
6 6
7 #include <cstdarg> 7 #include <cstdarg>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 is_host_origin_set = true; 88 is_host_origin_set = true;
89 break; 89 break;
90 } 90 }
91 } 91 }
92 92
93 // On non-testing environment, when a secondary display is connected, a new 93 // On non-testing environment, when a secondary display is connected, a new
94 // native (i.e. X) window for the display is always created below the 94 // native (i.e. X) window for the display is always created below the
95 // previous one for GPU performance reasons. Try to emulate the behavior 95 // previous one for GPU performance reasons. Try to emulate the behavior
96 // unless host origins are explicitly set. 96 // unless host origins are explicitly set.
97 if (!is_host_origin_set) { 97 if (!is_host_origin_set) {
98 // Sart from (1,1) so that windows won't overlap with native mouse cursor. 98 // Start from (1,1) so that windows won't overlap with native mouse cursor.
99 // See |AshTestBase::SetUp()|. 99 // See |AshTestBase::SetUp()|.
100 int next_y = 1; 100 int next_y = 1;
101 for (DisplayInfoList::iterator iter = display_info_list.begin(); 101 for (DisplayInfoList::iterator iter = display_info_list.begin();
102 iter != display_info_list.end(); ++iter) { 102 iter != display_info_list.end(); ++iter) {
103 gfx::Rect bounds(iter->bounds_in_native().size()); 103 gfx::Rect bounds(iter->bounds_in_native().size());
104 bounds.set_x(1); 104 bounds.set_x(1);
105 bounds.set_y(next_y); 105 bounds.set_y(next_y);
106 next_y += bounds.height(); 106 next_y += bounds.height();
107 iter->SetBounds(bounds); 107 iter->SetBounds(bounds);
108 } 108 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 for (size_t i = 0; i < count; i++) { 197 for (size_t i = 0; i < count; i++) {
198 int64_t id = va_arg(args, int64_t); 198 int64_t id = va_arg(args, int64_t);
199 list.push_back(id); 199 list.push_back(id);
200 } 200 }
201 display::SortDisplayIdList(&list); 201 display::SortDisplayIdList(&list);
202 return list; 202 return list;
203 } 203 }
204 204
205 } // namespace test 205 } // namespace test
206 } // namespace ash 206 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/wm/always_on_top_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698