Fix translation extraction failure.
[chromium-blink-merge.git] / chrome / renderer / chrome_mock_render_thread.cc
blob64d809e76efcc579cceb0b5161b3c58829b8b18e
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
3 // found in the LICENSE file.
5 #include "chrome/renderer/chrome_mock_render_thread.h"
7 #include "base/single_thread_task_runner.h"
8 #include "testing/gtest/include/gtest/gtest.h"
10 #if defined(ENABLE_EXTENSIONS)
11 #include "extensions/common/extension_messages.h"
12 #endif
14 ChromeMockRenderThread::ChromeMockRenderThread() {
17 ChromeMockRenderThread::~ChromeMockRenderThread() {
20 scoped_refptr<base::SingleThreadTaskRunner>
21 ChromeMockRenderThread::GetIOMessageLoopProxy() {
22 return io_task_runner_;
25 void ChromeMockRenderThread::set_io_message_loop_proxy(
26 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
27 io_task_runner_ = task_runner;
30 bool ChromeMockRenderThread::OnMessageReceived(const IPC::Message& msg) {
31 if (content::MockRenderThread::OnMessageReceived(msg))
32 return true;
34 // Some messages we do special handling.
35 #if defined(ENABLE_EXTENSIONS)
36 bool handled = true;
37 IPC_BEGIN_MESSAGE_MAP(ChromeMockRenderThread, msg)
38 IPC_MESSAGE_HANDLER(ExtensionHostMsg_OpenChannelToExtension,
39 OnOpenChannelToExtension)
40 IPC_MESSAGE_UNHANDLED(handled = false)
41 IPC_END_MESSAGE_MAP()
42 return handled;
43 #else
44 return false;
45 #endif
48 #if defined(ENABLE_EXTENSIONS)
49 void ChromeMockRenderThread::OnOpenChannelToExtension(
50 int routing_id,
51 const ExtensionMsg_ExternalConnectionInfo& info,
52 const std::string& channel_name,
53 bool include_tls_channel_id,
54 int* port_id) {
55 *port_id = 0;
57 #endif