| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <utility> |
| 6 |
| 5 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 6 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 7 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 8 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 10 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
| 11 #include "ui/display/types/display_snapshot.h" | 13 #include "ui/display/types/display_snapshot.h" |
| 12 #include "ui/display/types/native_display_delegate.h" | 14 #include "ui/display/types/native_display_delegate.h" |
| 13 #include "ui/display/types/native_display_observer.h" | 15 #include "ui/display/types/native_display_observer.h" |
| 14 #include "ui/events/event.h" | 16 #include "ui/events/event.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 FROM_HERE, base::Bind(&WindowManager::OnConfigurationChanged, | 306 FROM_HERE, base::Bind(&WindowManager::OnConfigurationChanged, |
| 305 base::Unretained(this))); | 307 base::Unretained(this))); |
| 306 } | 308 } |
| 307 } | 309 } |
| 308 | 310 |
| 309 void WindowManager::OnDisplayConfigured(const gfx::Rect& bounds, bool success) { | 311 void WindowManager::OnDisplayConfigured(const gfx::Rect& bounds, bool success) { |
| 310 if (success) { | 312 if (success) { |
| 311 scoped_ptr<DemoWindow> window( | 313 scoped_ptr<DemoWindow> window( |
| 312 new DemoWindow(this, &renderer_factory_, bounds)); | 314 new DemoWindow(this, &renderer_factory_, bounds)); |
| 313 window->Start(); | 315 window->Start(); |
| 314 windows_.push_back(window.Pass()); | 316 windows_.push_back(std::move(window)); |
| 315 } else { | 317 } else { |
| 316 LOG(ERROR) << "Failed to configure display at " << bounds.ToString(); | 318 LOG(ERROR) << "Failed to configure display at " << bounds.ToString(); |
| 317 } | 319 } |
| 318 } | 320 } |
| 319 | 321 |
| 320 int main(int argc, char** argv) { | 322 int main(int argc, char** argv) { |
| 321 base::CommandLine::Init(argc, argv); | 323 base::CommandLine::Init(argc, argv); |
| 322 base::AtExitManager exit_manager; | 324 base::AtExitManager exit_manager; |
| 323 | 325 |
| 324 // Initialize logging so we can enable VLOG messages. | 326 // Initialize logging so we can enable VLOG messages. |
| 325 logging::LoggingSettings settings; | 327 logging::LoggingSettings settings; |
| 326 logging::InitLogging(settings); | 328 logging::InitLogging(settings); |
| 327 | 329 |
| 328 // Build UI thread message loop. This is used by platform | 330 // Build UI thread message loop. This is used by platform |
| 329 // implementations for event polling & running background tasks. | 331 // implementations for event polling & running background tasks. |
| 330 base::MessageLoopForUI message_loop; | 332 base::MessageLoopForUI message_loop; |
| 331 | 333 |
| 332 ui::OzonePlatform::InitializeForUI(); | 334 ui::OzonePlatform::InitializeForUI(); |
| 333 ui::KeyboardLayoutEngineManager::GetKeyboardLayoutEngine() | 335 ui::KeyboardLayoutEngineManager::GetKeyboardLayoutEngine() |
| 334 ->SetCurrentLayoutByName("us"); | 336 ->SetCurrentLayoutByName("us"); |
| 335 | 337 |
| 336 base::RunLoop run_loop; | 338 base::RunLoop run_loop; |
| 337 | 339 |
| 338 WindowManager window_manager(run_loop.QuitClosure()); | 340 WindowManager window_manager(run_loop.QuitClosure()); |
| 339 | 341 |
| 340 run_loop.Run(); | 342 run_loop.Run(); |
| 341 | 343 |
| 342 return 0; | 344 return 0; |
| 343 } | 345 } |
| OLD | NEW |