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 "services/native_viewport/app_delegate.h" | 5 #include "services/native_viewport/app_delegate.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "gpu/config/gpu_util.h" | 9 #include "gpu/config/gpu_util.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 logging::LoggingSettings settings; | 27 logging::LoggingSettings settings; |
28 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 28 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
29 logging::InitLogging(settings); | 29 logging::InitLogging(settings); |
30 } | 30 } |
31 | 31 |
32 void NativeViewportAppDelegate::Initialize(mojo::ApplicationImpl* application) { | 32 void NativeViewportAppDelegate::Initialize(mojo::ApplicationImpl* application) { |
33 application_ = application; | 33 application_ = application; |
34 | 34 |
35 InitLogging(application); | 35 InitLogging(application); |
36 tracing_.Initialize(application); | 36 tracing_.Initialize(application->shell(), &application->args()); |
37 | 37 |
38 // Apply the switch for kTouchEvents to CommandLine (if set). This allows | 38 // Apply the switch for kTouchEvents to CommandLine (if set). This allows |
39 // redirecting the mouse to a touch device on X for testing. | 39 // redirecting the mouse to a touch device on X for testing. |
40 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 40 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
41 const std::string touch_event_string("--" + | 41 const std::string touch_event_string("--" + |
42 std::string(switches::kTouchDevices)); | 42 std::string(switches::kTouchDevices)); |
43 auto touch_iter = std::find(application->args().begin(), | 43 auto touch_iter = std::find(application->args().begin(), |
44 application->args().end(), touch_event_string); | 44 application->args().end(), touch_event_string); |
45 if (touch_iter != application->args().end() && | 45 if (touch_iter != application->args().end() && |
46 ++touch_iter != application->args().end()) { | 46 ++touch_iter != application->args().end()) { |
(...skipping 28 matching lines...) Expand all Loading... |
75 mojo::InterfaceRequest<mojo::Gpu> gpu_request) { | 75 mojo::InterfaceRequest<mojo::Gpu> gpu_request) { |
76 if (!gpu_state_.get()) | 76 if (!gpu_state_.get()) |
77 gpu_state_ = new gles2::GpuState(); | 77 gpu_state_ = new gles2::GpuState(); |
78 new gles2::GpuImpl(gpu_request.Pass(), gpu_state_); | 78 new gles2::GpuImpl(gpu_request.Pass(), gpu_state_); |
79 }); | 79 }); |
80 | 80 |
81 return true; | 81 return true; |
82 } | 82 } |
83 | 83 |
84 } // namespace native_viewport | 84 } // namespace native_viewport |
OLD | NEW |