| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 // | 300 // |
| 301 // TODO(aa): We need to get rid of the need to pass this flag at all. It is | 301 // TODO(aa): We need to get rid of the need to pass this flag at all. It is |
| 302 // only used in one place in the renderer. | 302 // only used in one place in the renderer. |
| 303 if (profile()->GetExtensionsService()) { | 303 if (profile()->GetExtensionsService()) { |
| 304 if (profile()->GetExtensionsService()->extensions()->size() > 0 || | 304 if (profile()->GetExtensionsService()->extensions()->size() > 0 || |
| 305 profile()->GetExtensionsService()->extensions_enabled()) | 305 profile()->GetExtensionsService()->extensions_enabled()) |
| 306 cmd_line.AppendSwitch(switches::kEnableExtensions); | 306 cmd_line.AppendSwitch(switches::kEnableExtensions); |
| 307 } | 307 } |
| 308 | 308 |
| 309 // Pass on the browser locale. | 309 // Pass on the browser locale. |
| 310 const std::wstring locale = g_browser_process->GetApplicationLocale(); | 310 const std::string locale = g_browser_process->GetApplicationLocale(); |
| 311 cmd_line.AppendSwitchWithValue(switches::kLang, locale); | 311 cmd_line.AppendSwitchWithValue(switches::kLang, ASCIIToWide(locale)); |
| 312 | 312 |
| 313 // If we run a FieldTrial that we want to pass to the renderer, this is where | 313 // If we run a FieldTrial that we want to pass to the renderer, this is where |
| 314 // the SINGULAR trial name and value should be specified. Note that only one | 314 // the SINGULAR trial name and value should be specified. Note that only one |
| 315 // such flag should be passed/set in the renderer command line. | 315 // such flag should be passed/set in the renderer command line. |
| 316 | 316 |
| 317 // Today we're watching the impact of DNS on some page load times. | 317 // Today we're watching the impact of DNS on some page load times. |
| 318 FieldTrial* field_trial = FieldTrialList::Find("DnsImpact"); | 318 FieldTrial* field_trial = FieldTrialList::Find("DnsImpact"); |
| 319 if (field_trial && (field_trial->group() != FieldTrial::kNotParticipating)) | 319 if (field_trial && (field_trial->group() != FieldTrial::kNotParticipating)) |
| 320 cmd_line.AppendSwitchWithValue(switches::kForceFieldTestNameAndValue, | 320 cmd_line.AppendSwitchWithValue(switches::kForceFieldTestNameAndValue, |
| 321 ASCIIToWide(field_trial->MakePersistentString())); | 321 ASCIIToWide(field_trial->MakePersistentString())); |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 ExtensionMessageService* ems = ExtensionMessageService::GetInstance(context); | 879 ExtensionMessageService* ems = ExtensionMessageService::GetInstance(context); |
| 880 ems->AddEventListener(event_name, pid()); | 880 ems->AddEventListener(event_name, pid()); |
| 881 } | 881 } |
| 882 | 882 |
| 883 void BrowserRenderProcessHost::OnExtensionRemoveListener( | 883 void BrowserRenderProcessHost::OnExtensionRemoveListener( |
| 884 const std::string& event_name) { | 884 const std::string& event_name) { |
| 885 URLRequestContext* context = profile()->GetRequestContext(); | 885 URLRequestContext* context = profile()->GetRequestContext(); |
| 886 ExtensionMessageService* ems = ExtensionMessageService::GetInstance(context); | 886 ExtensionMessageService* ems = ExtensionMessageService::GetInstance(context); |
| 887 ems->RemoveEventListener(event_name, pid()); | 887 ems->RemoveEventListener(event_name, pid()); |
| 888 } | 888 } |
| OLD | NEW |