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

Unified Diff: ash/test/multi_display_manager_test_api.cc

Issue 11363124: Move DisplayManager and DisplayChangeObserverX11 from aura to ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix rebase Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/test/multi_display_manager_test_api.h ('k') | ash/wm/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/multi_display_manager_test_api.cc
diff --git a/ash/test/multi_display_manager_test_api.cc b/ash/test/multi_display_manager_test_api.cc
deleted file mode 100644
index 9d350163eab66c8dcfe736778b3b494287642f77..0000000000000000000000000000000000000000
--- a/ash/test/multi_display_manager_test_api.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/test/multi_display_manager_test_api.h"
-
-#include <vector>
-
-#include "ash/display/multi_display_manager.h"
-#include "ash/shell.h"
-#include "base/string_split.h"
-#include "ui/aura/root_window.h"
-#include "ui/gfx/display.h"
-
-namespace ash {
-namespace test {
-namespace {
-
-std::vector<gfx::Display> CreateDisplaysFromString(
- const std::string specs) {
- std::vector<gfx::Display> displays;
- std::vector<std::string> parts;
- base::SplitString(specs, ',', &parts);
- for (std::vector<std::string>::const_iterator iter = parts.begin();
- iter != parts.end(); ++iter) {
- displays.push_back(aura::DisplayManager::CreateDisplayFromSpec(*iter));
- }
- return displays;
-}
-
-} // namespace
-
-MultiDisplayManagerTestApi::MultiDisplayManagerTestApi(
- internal::MultiDisplayManager* display_manager)
- : display_manager_(display_manager) {
-}
-
-MultiDisplayManagerTestApi::~MultiDisplayManagerTestApi() {}
-
-void MultiDisplayManagerTestApi::UpdateDisplay(
- const std::string& display_specs) {
- std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs);
- display_manager_->SetDisplayIdsForTest(&displays);
- display_manager_->OnNativeDisplaysChanged(displays);
-
- bool is_host_origin_set = false;
- for (size_t i = 0; i < displays.size(); ++i) {
- if (displays[i].bounds_in_pixel().origin() != gfx::Point(0, 0)) {
- is_host_origin_set = true;
- break;
- }
- }
-
- // On non-testing environment, when a secondary display is connected, a new
- // native (i.e. X) window for the display is always created below the
- // previous one for GPU performance reasons. Try to emulate the behavior
- // unless host origins are explicitly set.
- if (!is_host_origin_set) {
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
- int next_y = 0;
- for (size_t i = 0; i < root_windows.size(); ++i) {
- const gfx::Size size = root_windows[i]->GetHostSize();
- root_windows[i]->SetHostBounds(gfx::Rect(gfx::Point(0, next_y), size));
- next_y += size.height();
- }
- }
-}
-
-
-} // namespace test
-} // namespace ash
« no previous file with comments | « ash/test/multi_display_manager_test_api.h ('k') | ash/wm/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698