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