Index: content/browser/web_contents/web_contents_impl.cc |
=================================================================== |
--- content/browser/web_contents/web_contents_impl.cc (revision 137875) |
+++ content/browser/web_contents/web_contents_impl.cc (working copy) |
@@ -229,6 +229,15 @@ |
delegate->AddNavigationHeaders(params->url, ¶ms->extra_headers); |
} |
+int GetSwitchValueInt( |
darin (slow to review)
2012/05/18 20:20:17
nit: GetSwitchValueInt -> GetSwitchValueAsInt
|
+ const CommandLine& command_line, |
+ const std::string& switch_string) { |
+ std::string string_value = command_line.GetSwitchValueASCII(switch_string); |
+ int int_value; |
darin (slow to review)
2012/05/18 20:20:17
nit: initialize int_value? or, check the return v
|
+ base::StringToInt(string_value, &int_value); |
+ return int_value; |
+} |
+ |
} // namespace |
namespace content { |
@@ -535,6 +544,19 @@ |
} |
#endif |
+ if (command_line.HasSwitch(switches::kDefaultTileWidth)) |
+ prefs.default_tile_width = std::max( |
+ 1, GetSwitchValueInt(command_line, switches::kDefaultTileWidth)); |
darin (slow to review)
2012/05/18 20:20:17
nit: maybe the lower bound value should just be a
|
+ if (command_line.HasSwitch(switches::kDefaultTileHeight)) |
+ prefs.default_tile_height = std::max( |
+ 1, GetSwitchValueInt(command_line, switches::kDefaultTileHeight)); |
+ if (command_line.HasSwitch(switches::kMaxUntiledLayerWidth)) |
+ prefs.max_untiled_layer_width = std::max( |
+ 1, GetSwitchValueInt(command_line, switches::kMaxUntiledLayerWidth)); |
+ if (command_line.HasSwitch(switches::kMaxUntiledLayerHeight)) |
+ prefs.max_untiled_layer_height = std::max( |
+ 1, GetSwitchValueInt(command_line, switches::kMaxUntiledLayerHeight)); |
+ |
content::GetContentClient()->browser()->OverrideWebkitPrefs(rvh, url, &prefs); |
return prefs; |