diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-28 09:22:44 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-28 09:22:44 +0000 |
commit | f08a247c471a213f294e6d368030ac7d11e34c28 (patch) | |
tree | 5f3f0166f409fce701d404420bcd42af07ccd95f /chrome | |
parent | fe353520ea60183a44c4e8374ab21687df7744c1 (diff) | |
download | chromium_src-f08a247c471a213f294e6d368030ac7d11e34c28.zip chromium_src-f08a247c471a213f294e6d368030ac7d11e34c28.tar.gz chromium_src-f08a247c471a213f294e6d368030ac7d11e34c28.tar.bz2 |
Remove extraneous uses of the --enable-user-script
switch. It's better to check this at one chokepoint
(initialization) and let the rest of the code work
the same, but end up as no-ops.
Review URL: http://codereview.chromium.org/18401
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8800 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_init.cc | 6 | ||||
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 16 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 17 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 3 |
4 files changed, 11 insertions, 31 deletions
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index 637f129..ce4febe 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -222,8 +222,6 @@ bool BrowserInit::LaunchWithProfile::Launch(Profile* profile, } } - profile->InitExtensions(); - return true; } @@ -385,6 +383,10 @@ bool BrowserInit::ProcessCommandLine(const CommandLine& parsed_command_line, CreateAutomationProvider<AutomationProvider>(automation_channel_id, profile, expected_tabs); } + + // Start up the extensions service. + profile->InitExtensions(); + // If we don't want to launch a new browser window or tab (in the case // of an automation request), we are done here. if (!silent_launch) { diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index c8b8e6e..1e1db05 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -267,7 +267,6 @@ bool BrowserRenderProcessHost::Init() { switches::kDisablePopupBlocking, switches::kUseLowFragHeapCrt, switches::kGearsInRenderer, - switches::kEnableUserScripts, switches::kEnableVideo, }; @@ -515,21 +514,8 @@ void BrowserRenderProcessHost::InitVisitedLinks() { } void BrowserRenderProcessHost::InitUserScripts() { - if (!CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableUserScripts)) { - return; - } - - // TODO(aa): Figure out lifetime and ownership of this object - // - VisitedLinkMaster is owned by Profile, but there has been talk of - // having scripts live elsewhere besides the profile. - // - File IO should be asynchronous (see VisitedLinkMaster), but how do we - // get scripts to the first renderer without blocking startup? Should we - // cache some information across restarts? UserScriptMaster* user_script_master = profile()->GetUserScriptMaster(); - if (!user_script_master) { - return; - } + DCHECK(user_script_master); if (!user_script_master->ScriptsReady()) { // No scripts ready. :( diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 1544198..0eb16ee 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -172,7 +172,6 @@ RenderView::RenderView(RenderThreadBase* render_thread) disable_popup_blocking_(false), has_unload_listener_(false), decrement_shared_popup_at_destruction_(false), - user_scripts_enabled_(false), waiting_for_create_window_ack_(false), form_field_autofill_request_id_(0), popup_notification_visible_(false), @@ -317,8 +316,6 @@ void RenderView::Init(gfx::NativeViewId parent_hwnd, command_line.HasSwitch(switches::kDomAutomationController); disable_popup_blocking_ = command_line.HasSwitch(switches::kDisablePopupBlocking); - user_scripts_enabled_ = - command_line.HasSwitch(switches::kEnableUserScripts); debug_message_handler_ = new DebugMessageHandler(this); render_thread_->AddFilter(debug_message_handler_); @@ -1491,14 +1488,12 @@ void RenderView::DidFinishDocumentLoadForFrame(WebView* webview, // Inject any user scripts. Do not inject into chrome UI pages, but do inject // into any other document. - if (user_scripts_enabled_) { - const GURL &gurl = frame->GetURL(); - if (g_render_thread && // Will be NULL when testing. - (gurl.SchemeIs("file") || - gurl.SchemeIs("http") || - gurl.SchemeIs("https"))) { - g_render_thread->user_script_slave()->InjectScripts(frame); - } + const GURL &gurl = frame->GetURL(); + if (g_render_thread && // Will be NULL when testing. + (gurl.SchemeIs("file") || + gurl.SchemeIs("http") || + gurl.SchemeIs("https"))) { + g_render_thread->user_script_slave()->InjectScripts(frame); } } diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 49b0be1..5aff4bd 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -702,9 +702,6 @@ class RenderView : public RenderWidget, // maintains the cache and other features of the accessibility tree. scoped_ptr<GlueAccessibility> glue_accessibility_; - // True if user scripts are enabled in this process. - bool user_scripts_enabled_; - // Resource message queue. Used to queue up resource IPCs if we need // to wait for an ACK from the browser before proceeding. std::queue<IPC::Message*> queued_resource_messages_; |