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

Side by Side Diff: chrome/browser/tab_contents/render_view_host_delegate_helper.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 "render_view_host_delegate_helper.h" 5 #include "render_view_host_delegate_helper.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/browser.h" 8 #include "chrome/browser/browser.h"
9 #include "chrome/browser/character_encoding.h" 9 #include "chrome/browser/character_encoding.h"
10 #include "chrome/browser/profile.h" 10 #include "chrome/browser/profile.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 prefs->GetBoolean(prefs::kWebKitLoadsImagesAutomatically); 172 prefs->GetBoolean(prefs::kWebKitLoadsImagesAutomatically);
173 web_prefs.uses_page_cache = 173 web_prefs.uses_page_cache =
174 command_line.HasSwitch(switches::kEnableFastback); 174 command_line.HasSwitch(switches::kEnableFastback);
175 web_prefs.remote_fonts_enabled = 175 web_prefs.remote_fonts_enabled =
176 command_line.HasSwitch(switches::kEnableRemoteFonts); 176 command_line.HasSwitch(switches::kEnableRemoteFonts);
177 web_prefs.xss_auditor_enabled = 177 web_prefs.xss_auditor_enabled =
178 command_line.HasSwitch(switches::kEnableXSSAuditor); 178 command_line.HasSwitch(switches::kEnableXSSAuditor);
179 web_prefs.application_cache_enabled = 179 web_prefs.application_cache_enabled =
180 command_line.HasSwitch(switches::kEnableApplicationCache); 180 command_line.HasSwitch(switches::kEnableApplicationCache);
181 181
182 // NOTE: We imply local storage enabledness for extensions because the
183 // extensions team is beta testing local storage and we like to live on the
184 // edge.
185 web_prefs.local_storage_enabled = 182 web_prefs.local_storage_enabled =
186 command_line.HasSwitch(switches::kEnableLocalStorage) || 183 command_line.HasSwitch(switches::kEnableLocalStorage);
187 command_line.HasSwitch(switches::kEnableExtensions); 184 web_prefs.databases_enabled =
185 command_line.HasSwitch(switches::kEnableDatabases);
188 web_prefs.session_storage_enabled = 186 web_prefs.session_storage_enabled =
189 command_line.HasSwitch(switches::kEnableSessionStorage); 187 command_line.HasSwitch(switches::kEnableSessionStorage);
190 } 188 }
191 189
192 web_prefs.uses_universal_detector = 190 web_prefs.uses_universal_detector =
193 prefs->GetBoolean(prefs::kWebKitUsesUniversalDetector); 191 prefs->GetBoolean(prefs::kWebKitUsesUniversalDetector);
194 web_prefs.text_areas_are_resizable = 192 web_prefs.text_areas_are_resizable =
195 prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable); 193 prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable);
196 194
197 // User CSS is currently disabled because it crashes chrome. See 195 // User CSS is currently disabled because it crashes chrome. See
(...skipping 10 matching lines...) Expand all
208 } 206 }
209 DCHECK(!web_prefs.default_encoding.empty()); 207 DCHECK(!web_prefs.default_encoding.empty());
210 208
211 if (is_dom_ui) { 209 if (is_dom_ui) {
212 web_prefs.loads_images_automatically = true; 210 web_prefs.loads_images_automatically = true;
213 web_prefs.javascript_enabled = true; 211 web_prefs.javascript_enabled = true;
214 } 212 }
215 213
216 return web_prefs; 214 return web_prefs;
217 } 215 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698