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