OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 #include <limits> | 11 #include <limits> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #if defined(OS_POSIX) | 14 #if defined(OS_POSIX) |
15 #include <utility> // for pair<> | 15 #include <utility> // for pair<> |
16 #endif | 16 #endif |
17 | 17 |
18 #include "app/app_switches.h" | 18 #include "app/app_switches.h" |
19 #include "base/command_line.h" | 19 #include "base/command_line.h" |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
21 #include "base/metrics/field_trial.h" | 21 #include "base/metrics/field_trial.h" |
22 #include "base/metrics/histogram.h" | 22 #include "base/metrics/histogram.h" |
23 #include "base/path_service.h" | 23 #include "base/path_service.h" |
24 #include "base/platform_file.h" | 24 #include "base/platform_file.h" |
25 #include "base/stl_util-inl.h" | 25 #include "base/stl_util-inl.h" |
26 #include "base/string_util.h" | 26 #include "base/string_util.h" |
27 #include "base/thread.h" | 27 #include "base/thread.h" |
| 28 #include "base/thread_restrictions.h" |
28 #include "chrome/browser/browser_child_process_host.h" | 29 #include "chrome/browser/browser_child_process_host.h" |
29 #include "chrome/browser/browser_process.h" | 30 #include "chrome/browser/browser_process.h" |
30 #include "chrome/browser/child_process_security_policy.h" | 31 #include "chrome/browser/child_process_security_policy.h" |
31 #include "chrome/browser/extensions/extension_event_router.h" | 32 #include "chrome/browser/extensions/extension_event_router.h" |
32 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 33 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
33 #include "chrome/browser/extensions/extension_message_service.h" | 34 #include "chrome/browser/extensions/extension_message_service.h" |
34 #include "chrome/browser/extensions/extensions_service.h" | 35 #include "chrome/browser/extensions/extensions_service.h" |
35 #include "chrome/browser/extensions/user_script_master.h" | 36 #include "chrome/browser/extensions/user_script_master.h" |
36 #include "chrome/browser/gpu_process_host.h" | 37 #include "chrome/browser/gpu_process_host.h" |
37 #include "chrome/browser/history/history.h" | 38 #include "chrome/browser/history/history.h" |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 } | 683 } |
683 | 684 |
684 void BrowserRenderProcessHost::InitSpeechInput() { | 685 void BrowserRenderProcessHost::InitSpeechInput() { |
685 bool enabled = true; | 686 bool enabled = true; |
686 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 687 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
687 | 688 |
688 if (command_line.HasSwitch(switches::kDisableSpeechInput)) { | 689 if (command_line.HasSwitch(switches::kDisableSpeechInput)) { |
689 enabled = false; | 690 enabled = false; |
690 #if defined(GOOGLE_CHROME_BUILD) | 691 #if defined(GOOGLE_CHROME_BUILD) |
691 } else if (!command_line.HasSwitch(switches::kEnableSpeechInput)) { | 692 } else if (!command_line.HasSwitch(switches::kEnableSpeechInput)) { |
| 693 // We need to evaluate whether IO is OK here. http://crbug.com/63335. |
| 694 base::ThreadRestrictions::ScopedAllowIO allow_io; |
692 // Official Chrome builds don't have speech input enabled by default in the | 695 // Official Chrome builds don't have speech input enabled by default in the |
693 // beta and stable channels. | 696 // beta and stable channels. |
694 std::string channel = platform_util::GetVersionStringModifier(); | 697 std::string channel = platform_util::GetVersionStringModifier(); |
695 enabled = (!channel.empty() && channel != "beta"); | 698 enabled = (!channel.empty() && channel != "beta"); |
696 #endif | 699 #endif |
697 } | 700 } |
698 | 701 |
699 Send(new ViewMsg_SpeechInput_SetFeatureEnabled(enabled)); | 702 Send(new ViewMsg_SpeechInput_SetFeatureEnabled(enabled)); |
700 } | 703 } |
701 | 704 |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 IPC::InvalidPlatformFileForTransit(), | 1170 IPC::InvalidPlatformFileForTransit(), |
1168 std::vector<std::string>(), | 1171 std::vector<std::string>(), |
1169 std::string(), | 1172 std::string(), |
1170 false)); | 1173 false)); |
1171 } | 1174 } |
1172 } | 1175 } |
1173 | 1176 |
1174 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { | 1177 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { |
1175 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); | 1178 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); |
1176 } | 1179 } |
OLD | NEW |