| OLD | NEW |
| 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/monitor/multi_monitor_manager.h" | 5 #include "ash/monitor/multi_monitor_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 using std::vector; | 38 using std::vector; |
| 39 using aura::Monitor; | 39 using aura::Monitor; |
| 40 using aura::RootWindow; | 40 using aura::RootWindow; |
| 41 using aura::Window; | 41 using aura::Window; |
| 42 | 42 |
| 43 MultiMonitorManager::MultiMonitorManager() { | 43 MultiMonitorManager::MultiMonitorManager() { |
| 44 Init(); | 44 Init(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 MultiMonitorManager::~MultiMonitorManager() { | 47 MultiMonitorManager::~MultiMonitorManager() { |
| 48 // All monitors must have been deleted when monitor manager is deleted. | 48 // All monitors must have been deleted when root windows are deleted. |
| 49 CHECK(!monitors_.size()); | 49 DCHECK(!monitors_.size()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // static | 52 // static |
| 53 void MultiMonitorManager::AddRemoveMonitor() { | 53 void MultiMonitorManager::AddRemoveMonitor() { |
| 54 MultiMonitorManager* manager = static_cast<MultiMonitorManager*>( | 54 MultiMonitorManager* manager = static_cast<MultiMonitorManager*>( |
| 55 aura::Env::GetInstance()->monitor_manager()); | 55 aura::Env::GetInstance()->monitor_manager()); |
| 56 manager->AddRemoveMonitorImpl(); | 56 manager->AddRemoveMonitorImpl(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void MultiMonitorManager::CycleMonitor() { | 59 void MultiMonitorManager::CycleMonitor() { |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 iter != monitors_.end(); ++iter) | 199 iter != monitors_.end(); ++iter) |
| 200 new_monitors.push_back(Copy(*iter)); | 200 new_monitors.push_back(Copy(*iter)); |
| 201 new_monitors.push_back(Copy(monitors_.front())); | 201 new_monitors.push_back(Copy(monitors_.front())); |
| 202 OnNativeMonitorsChanged(new_monitors); | 202 OnNativeMonitorsChanged(new_monitors); |
| 203 STLDeleteContainerPointers(new_monitors.begin(), new_monitors.end()); | 203 STLDeleteContainerPointers(new_monitors.begin(), new_monitors.end()); |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace internal | 207 } // namespace internal |
| 208 } // namespace ash | 208 } // namespace ash |
| OLD | NEW |