OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/renderer_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 blink::WebPlatformEventType type, | 1161 blink::WebPlatformEventType type, |
1162 scoped_ptr<PlatformEventObserverBase> observer) { | 1162 scoped_ptr<PlatformEventObserverBase> observer) { |
1163 if (platform_event_observers_.Lookup(type)) | 1163 if (platform_event_observers_.Lookup(type)) |
1164 platform_event_observers_.Remove(type); | 1164 platform_event_observers_.Remove(type); |
1165 platform_event_observers_.AddWithID(observer.release(), type); | 1165 platform_event_observers_.AddWithID(observer.release(), type); |
1166 } | 1166 } |
1167 | 1167 |
1168 void RendererBlinkPlatformImpl::connectToRemoteService( | 1168 void RendererBlinkPlatformImpl::connectToRemoteService( |
1169 const char* name, | 1169 const char* name, |
1170 mojo::ScopedMessagePipeHandle handle) { | 1170 mojo::ScopedMessagePipeHandle handle) { |
1171 // In the layout test mode, mock services should be used instead. | |
1172 // TODO(yukishiino): We'd like to inject mock services implemented in | |
1173 // JavaScript. Remove the following hack once we support JS-bindings | |
1174 // of Mojo and service mocking in JS. | |
1175 if (RenderThreadImpl::current() && | |
1176 RenderThreadImpl::current()->layout_test_mode()) | |
1177 return; | |
1178 | |
1179 RenderThread::Get()->GetServiceRegistry()->ConnectToRemoteService( | 1171 RenderThread::Get()->GetServiceRegistry()->ConnectToRemoteService( |
1180 name, std::move(handle)); | 1172 name, std::move(handle)); |
1181 } | 1173 } |
1182 | 1174 |
1183 void RendererBlinkPlatformImpl::startListening( | 1175 void RendererBlinkPlatformImpl::startListening( |
1184 blink::WebPlatformEventType type, | 1176 blink::WebPlatformEventType type, |
1185 blink::WebPlatformEventListener* listener) { | 1177 blink::WebPlatformEventListener* listener) { |
1186 PlatformEventObserverBase* observer = platform_event_observers_.Lookup(type); | 1178 PlatformEventObserverBase* observer = platform_event_observers_.Lookup(type); |
1187 if (!observer) { | 1179 if (!observer) { |
1188 observer = CreatePlatformEventObserverFromType(type); | 1180 observer = CreatePlatformEventObserverFromType(type); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 } | 1257 } |
1266 | 1258 |
1267 //------------------------------------------------------------------------------ | 1259 //------------------------------------------------------------------------------ |
1268 | 1260 |
1269 blink::WebTrialTokenValidator* | 1261 blink::WebTrialTokenValidator* |
1270 RendererBlinkPlatformImpl::trialTokenValidator() { | 1262 RendererBlinkPlatformImpl::trialTokenValidator() { |
1271 return &trial_token_validator_; | 1263 return &trial_token_validator_; |
1272 } | 1264 } |
1273 | 1265 |
1274 } // namespace content | 1266 } // namespace content |
OLD | NEW |