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

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

Issue 173306: Force databases and localstorage to be enabled extensions. (Closed)
Patch Set: cleanup Created 11 years, 4 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "chrome/browser/renderer_host/render_view_host.h" 5 #include "chrome/browser/renderer_host/render_view_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 0); 201 0);
202 DCHECK(result) << 202 DCHECK(result) <<
203 "Couldn't duplicate the modal dialog handle for the renderer."; 203 "Couldn't duplicate the modal dialog handle for the renderer.";
204 #endif 204 #endif
205 205
206 ModalDialogEvent modal_dialog_event; 206 ModalDialogEvent modal_dialog_event;
207 #if defined(OS_WIN) 207 #if defined(OS_WIN)
208 modal_dialog_event.event = modal_dialog_event_handle; 208 modal_dialog_event.event = modal_dialog_event_handle;
209 #endif 209 #endif
210 210
211 // Force local storage to be enabled for extensions. This is so that we can
212 // enable extensions by default before databases, if necessary.
213 // TODO(aa): This should be removed when local storage and databases are
214 // enabled by default (bugs 4359 and 4360).
215 WebPreferences webkit_prefs = delegate_->GetWebkitPrefs();
216 if (delegate_->GetURL().SchemeIs(chrome::kExtensionScheme)) {
217 webkit_prefs.local_storage_enabled = true;
218 webkit_prefs.databases_enabled = true;
219 }
220
211 Send(new ViewMsg_New(GetNativeViewId(), 221 Send(new ViewMsg_New(GetNativeViewId(),
212 modal_dialog_event, 222 modal_dialog_event,
213 delegate_->GetRendererPrefs(), 223 delegate_->GetRendererPrefs(),
214 delegate_->GetWebkitPrefs(), 224 webkit_prefs,
215 routing_id())); 225 routing_id()));
216 226
217 // Set the alternate error page, which is profile specific, in the renderer. 227 // Set the alternate error page, which is profile specific, in the renderer.
218 GURL url = delegate_->GetAlternateErrorPageURL(); 228 GURL url = delegate_->GetAlternateErrorPageURL();
219 SetAlternateErrorPageURL(url); 229 SetAlternateErrorPageURL(url);
220 230
221 // If it's enabled, tell the renderer to set up the Javascript bindings for 231 // If it's enabled, tell the renderer to set up the Javascript bindings for
222 // sending messages back to the browser. 232 // sending messages back to the browser.
223 Send(new ViewMsg_AllowBindings(routing_id(), enabled_bindings_)); 233 Send(new ViewMsg_AllowBindings(routing_id(), enabled_bindings_));
224 UpdateBrowserWindowId(delegate_->GetBrowserWindowID()); 234 UpdateBrowserWindowId(delegate_->GetBrowserWindowID());
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 } 1651 }
1642 1652
1643 void RenderViewHost::ResetModalDialogEvent() { 1653 void RenderViewHost::ResetModalDialogEvent() {
1644 if (--modal_dialog_count_ == 0) 1654 if (--modal_dialog_count_ == 0)
1645 modal_dialog_event_->Reset(); 1655 modal_dialog_event_->Reset();
1646 } 1656 }
1647 1657
1648 void RenderViewHost::UpdateBrowserWindowId(int window_id) { 1658 void RenderViewHost::UpdateBrowserWindowId(int window_id) {
1649 Send(new ViewMsg_UpdateBrowserWindowId(routing_id(), window_id)); 1659 Send(new ViewMsg_UpdateBrowserWindowId(routing_id(), window_id));
1650 } 1660 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698