Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: chrome/browser/renderer_host/browser_render_process_host.cc

Issue 189005: Revert 25204 - Revert 24846 Enable extensions by default.... (Closed) Base URL: svn://chrome-svn/chrome/branches/205/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 switches::kEnableDatabases, 342 switches::kEnableDatabases,
343 }; 343 };
344 344
345 for (size_t i = 0; i < arraysize(switch_names); ++i) { 345 for (size_t i = 0; i < arraysize(switch_names); ++i) {
346 if (browser_command_line.HasSwitch(switch_names[i])) { 346 if (browser_command_line.HasSwitch(switch_names[i])) {
347 cmd_line.AppendSwitchWithValue(switch_names[i], 347 cmd_line.AppendSwitchWithValue(switch_names[i],
348 browser_command_line.GetSwitchValue(switch_names[i])); 348 browser_command_line.GetSwitchValue(switch_names[i]));
349 } 349 }
350 } 350 }
351 351
352 // Tell the renderer to enable extensions if there are any extensions loaded.
353 //
354 // NOTE: This is subtly different than just passing along whether
355 // --enable-extenisons is present in the browser process. For example, there
356 // is also an extensions.enabled preference, and there may be various special
357 // cases about whether to allow extensions to load.
358 //
359 // This introduces a race condition where the first renderer never gets
360 // extensions enabled, so we also set the flag if extensions_enabled(). This
361 // isn't perfect though, because of the special cases above.
362 //
363 // TODO(aa): We need to get rid of the need to pass this flag at all. It is
364 // only used in one place in the renderer.
365 if (profile()->GetExtensionsService()) {
366 if (profile()->GetExtensionsService()->extensions()->size() > 0 ||
367 profile()->GetExtensionsService()->extensions_enabled())
368 cmd_line.AppendSwitch(switches::kEnableExtensions);
369 }
370
371 // Pass on the browser locale. 352 // Pass on the browser locale.
372 const std::string locale = g_browser_process->GetApplicationLocale(); 353 const std::string locale = g_browser_process->GetApplicationLocale();
373 cmd_line.AppendSwitchWithValue(switches::kLang, ASCIIToWide(locale)); 354 cmd_line.AppendSwitchWithValue(switches::kLang, ASCIIToWide(locale));
374 355
375 // If we run FieldTrials, we want to pass to their state to the renderer so 356 // If we run FieldTrials, we want to pass to their state to the renderer so
376 // that it can act in accordance with each state, or record histograms 357 // that it can act in accordance with each state, or record histograms
377 // relating to the FieldTrial states. 358 // relating to the FieldTrial states.
378 std::string field_trial_states; 359 std::string field_trial_states;
379 FieldTrialList::StatesToString(&field_trial_states); 360 FieldTrialList::StatesToString(&field_trial_states);
380 if (!field_trial_states.empty()) 361 if (!field_trial_states.empty())
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 profile()->GetExtensionMessageService()->RemoveEventListener( 959 profile()->GetExtensionMessageService()->RemoveEventListener(
979 event_name, id()); 960 event_name, id());
980 } 961 }
981 } 962 }
982 963
983 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) { 964 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) {
984 if (profile()->GetExtensionMessageService()) { 965 if (profile()->GetExtensionMessageService()) {
985 profile()->GetExtensionMessageService()->CloseChannel(port_id); 966 profile()->GetExtensionMessageService()->CloseChannel(port_id);
986 } 967 }
987 } 968 }
OLDNEW
« no previous file with comments | « chrome/browser/profile.cc ('k') | chrome/browser/renderer_host/test/render_view_host_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698