| 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/ppapi_plugin/ppapi_thread.h" | 5 #include "content/ppapi_plugin/ppapi_thread.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 return &globally_seen_instance_ids_; | 161 return &globally_seen_instance_ids_; |
| 162 } | 162 } |
| 163 | 163 |
| 164 bool PpapiThread::SendToBrowser(IPC::Message* msg) { | 164 bool PpapiThread::SendToBrowser(IPC::Message* msg) { |
| 165 if (MessageLoop::current() == message_loop()) | 165 if (MessageLoop::current() == message_loop()) |
| 166 return ChildThread::Send(msg); | 166 return ChildThread::Send(msg); |
| 167 | 167 |
| 168 return sync_message_filter()->Send(msg); | 168 return sync_message_filter()->Send(msg); |
| 169 } | 169 } |
| 170 | 170 |
| 171 IPC::Sender* PpapiThread::GetBrowserSender() { |
| 172 return this; |
| 173 } |
| 174 |
| 171 std::string PpapiThread::GetUILanguage() { | 175 std::string PpapiThread::GetUILanguage() { |
| 172 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 176 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 173 return command_line->GetSwitchValueASCII(switches::kLang); | 177 return command_line->GetSwitchValueASCII(switches::kLang); |
| 174 } | 178 } |
| 175 | 179 |
| 176 void PpapiThread::PreCacheFont(const void* logfontw) { | 180 void PpapiThread::PreCacheFont(const void* logfontw) { |
| 177 #if defined(OS_WIN) | 181 #if defined(OS_WIN) |
| 178 Send(new ChildProcessHostMsg_PreCacheFont( | 182 Send(new ChildProcessHostMsg_PreCacheFont( |
| 179 *static_cast<const LOGFONTW*>(logfontw))); | 183 *static_cast<const LOGFONTW*>(logfontw))); |
| 180 #endif | 184 #endif |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 ppapi::proxy::PluginGlobals::Get()->set_plugin_name( | 380 ppapi::proxy::PluginGlobals::Get()->set_plugin_name( |
| 377 path.BaseName().AsUTF8Unsafe()); | 381 path.BaseName().AsUTF8Unsafe()); |
| 378 | 382 |
| 379 // plugin() is NULL when in-process. Which is fine, because this is | 383 // plugin() is NULL when in-process. Which is fine, because this is |
| 380 // just a hook for setting the process name. | 384 // just a hook for setting the process name. |
| 381 if (content::GetContentClient()->plugin()) { | 385 if (content::GetContentClient()->plugin()) { |
| 382 content::GetContentClient()->plugin()->PluginProcessStarted( | 386 content::GetContentClient()->plugin()->PluginProcessStarted( |
| 383 path.BaseName().RemoveExtension().LossyDisplayName()); | 387 path.BaseName().RemoveExtension().LossyDisplayName()); |
| 384 } | 388 } |
| 385 } | 389 } |
| OLD | NEW |