OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/display/mirror_window_controller.h" | 5 #include "ash/display/mirror_window_controller.h" |
6 | 6 |
7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 // Xlib.h defines RootWindow. | 10 // Xlib.h defines RootWindow. |
11 #undef RootWindow | 11 #undef RootWindow |
12 #endif | 12 #endif |
13 | 13 |
| 14 #include "ash/display/display_controller.h" |
14 #include "ash/display/display_info.h" | 15 #include "ash/display/display_info.h" |
15 #include "ash/display/display_manager.h" | 16 #include "ash/display/display_manager.h" |
16 #include "ash/display/root_window_transformers.h" | 17 #include "ash/display/root_window_transformers.h" |
17 #include "ash/host/root_window_host_factory.h" | 18 #include "ash/host/root_window_host_factory.h" |
18 #include "ash/shell.h" | 19 #include "ash/shell.h" |
19 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
20 #include "ui/aura/client/capture_client.h" | 21 #include "ui/aura/client/capture_client.h" |
21 #include "ui/aura/env.h" | 22 #include "ui/aura/env.h" |
22 #include "ui/aura/root_window.h" | 23 #include "ui/aura/root_window.h" |
23 #include "ui/aura/root_window_transformer.h" | 24 #include "ui/aura/root_window_transformer.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 cursor_window_(NULL), | 149 cursor_window_(NULL), |
149 cursor_window_delegate_(new CursorWindowDelegate) { | 150 cursor_window_delegate_(new CursorWindowDelegate) { |
150 } | 151 } |
151 | 152 |
152 MirrorWindowController::~MirrorWindowController() { | 153 MirrorWindowController::~MirrorWindowController() { |
153 // Make sure the root window gets deleted before cursor_window_delegate. | 154 // Make sure the root window gets deleted before cursor_window_delegate. |
154 Close(); | 155 Close(); |
155 } | 156 } |
156 | 157 |
157 void MirrorWindowController::UpdateWindow(const DisplayInfo& display_info) { | 158 void MirrorWindowController::UpdateWindow(const DisplayInfo& display_info) { |
| 159 if (Shell::GetInstance()->display_controller()->in_bootstrap()) |
| 160 return; |
| 161 |
158 static int mirror_root_window_count = 0; | 162 static int mirror_root_window_count = 0; |
159 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 163 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
160 | 164 |
161 if (!root_window_.get()) { | 165 if (!root_window_.get()) { |
162 const gfx::Rect& bounds_in_pixel = display_info.bounds_in_pixel(); | 166 const gfx::Rect& bounds_in_pixel = display_info.bounds_in_pixel(); |
163 aura::RootWindow::CreateParams params(bounds_in_pixel); | 167 aura::RootWindow::CreateParams params(bounds_in_pixel); |
164 params.host = Shell::GetInstance()->root_window_host_factory()-> | 168 params.host = Shell::GetInstance()->root_window_host_factory()-> |
165 CreateRootWindowHost(bounds_in_pixel); | 169 CreateRootWindowHost(bounds_in_pixel); |
166 root_window_.reset(new aura::RootWindow(params)); | 170 root_window_.reset(new aura::RootWindow(params)); |
167 root_window_->SetName( | 171 root_window_->SetName( |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 Shell::GetScreen()->GetPrimaryDisplay().id()); | 335 Shell::GetScreen()->GetPrimaryDisplay().id()); |
332 DCHECK(display_manager->mirrored_display().is_valid()); | 336 DCHECK(display_manager->mirrored_display().is_valid()); |
333 return scoped_ptr<aura::RootWindowTransformer>( | 337 return scoped_ptr<aura::RootWindowTransformer>( |
334 internal::CreateRootWindowTransformerForMirroredDisplay( | 338 internal::CreateRootWindowTransformerForMirroredDisplay( |
335 source_display_info, | 339 source_display_info, |
336 mirror_display_info)); | 340 mirror_display_info)); |
337 } | 341 } |
338 | 342 |
339 } // namespace internal | 343 } // namespace internal |
340 } // namespace ash | 344 } // namespace ash |
OLD | NEW |