~osomon/oxide/bug1290821

« back to all changes in this revision

Viewing changes to shared/browser/oxide_content_browser_client.cc

  • Committer: Chris Coulson
  • Date: 2014-02-20 14:42:23 UTC
  • Revision ID: chris.coulson@canonical.com-20140220144223-cm4jsx5sfhm1movd
Implement WebPreferenceObserver, as this will make testing easier. Also, get rid of the default preferences hack and don't lazy initialize the default WebPreferences

Show diffs side-by-side

added added

removed removed

Lines of Context:
242
242
    content::RenderViewHost* render_view_host,
243
243
    const GURL& url,
244
244
    ::WebPreferences* prefs) {
245
 
 
246
245
  WebView* view = WebView::FromRenderViewHost(render_view_host);
247
246
  WebPreferences* web_prefs = view->GetWebPreferences();
248
 
  if (web_prefs) {
249
 
    web_prefs->ApplyToWebkitPrefs(prefs);
 
247
  if (!web_prefs) {
 
248
    DLOG(WARNING) << "No WebPreferences on WebView";
 
249
    return;
250
250
  }
251
251
 
 
252
  web_prefs->ApplyToWebkitPrefs(prefs);
 
253
 
252
254
  prefs->device_supports_mouse = true; // XXX: Can we detect this?
253
255
  prefs->device_supports_touch = prefs->touch_enabled && IsTouchSupported();
254
256
}
263
265
  return context->share_group();
264
266
}
265
267
 
266
 
WebPreferences* ContentBrowserClient::GetDefaultWebPreferences() {
267
 
  return NULL;
268
 
}
269
 
 
270
268
bool ContentBrowserClient::IsTouchSupported() {
271
269
  return false;
272
270
}