~rpadovani/oxide/type-info

« back to all changes in this revision

Viewing changes to shared/browser/oxide_content_browser_client.cc

  • Committer: Riccardo Padovani
  • Date: 2015-10-19 07:56:29 UTC
  • mfrom: (1088.1.131 oxide)
  • Revision ID: riccardo@rpadovani.com-20151019075629-z0mlhwlb9xflkovw
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
#include "shared/browser/compositor/oxide_compositor_utils.h"
37
37
#include "shared/browser/media/oxide_media_capture_devices_dispatcher.h"
 
38
#include "shared/browser/notifications/oxide_platform_notification_service.h"
38
39
#include "shared/common/oxide_constants.h"
39
40
#include "shared/common/oxide_content_client.h"
40
 
#include "shared/common/oxide_messages.h"
 
41
#include "shared/common/oxide_form_factor.h"
41
42
 
42
43
#include "oxide_access_token_store.h"
43
44
#include "oxide_android_properties.h"
45
46
#include "oxide_browser_main_parts.h"
46
47
#include "oxide_browser_platform_integration.h"
47
48
#include "oxide_browser_process_main.h"
48
 
#include "oxide_form_factor.h"
49
49
#include "oxide_quota_permission_context.h"
 
50
#include "oxide_render_message_filter.h"
50
51
#include "oxide_resource_dispatcher_host_delegate.h"
51
 
#include "oxide_user_agent_override_provider.h"
 
52
#include "oxide_user_agent_settings.h"
52
53
#include "oxide_web_preferences.h"
53
54
#include "oxide_web_view.h"
54
55
#include "oxide_web_view_contents_helper.h"
57
58
#include "content/public/browser/browser_ppapi_host.h"
58
59
#include "ppapi/host/ppapi_host.h"
59
60
 
60
 
#include "oxide_pepper_host_factory_browser.h"
 
61
#include "pepper/oxide_pepper_host_factory_browser.h"
61
62
#endif
62
63
 
63
64
namespace oxide {
69
70
 
70
71
void ContentBrowserClient::RenderProcessWillLaunch(
71
72
    content::RenderProcessHost* host) {
72
 
  host->Send(new OxideMsg_SetUserAgent(
73
 
      BrowserContext::FromContent(host->GetBrowserContext())->GetUserAgent()));
74
 
  host->AddFilter(new UserAgentOverrideProvider(host));
 
73
  host->AddFilter(new RenderMessageFilter(host));
75
74
}
76
75
 
77
76
net::URLRequestContextGetter* ContentBrowserClient::CreateRequestContext(
98
97
 
99
98
std::string ContentBrowserClient::GetAcceptLangs(
100
99
    content::BrowserContext* browser_context) {
101
 
  return BrowserContext::FromContent(browser_context)->GetAcceptLangs();
 
100
  return UserAgentSettings::Get(browser_context)->GetAcceptLangs();
102
101
}
103
102
 
104
103
void ContentBrowserClient::AppendExtraCommandLineSwitches(
107
106
  // This can be called on the UI or IO thread
108
107
  static const char* const kSwitchNames[] = {
109
108
    switches::kEnableGoogleTalkPlugin,
 
109
    switches::kEnablePepperFlashPlugin,
 
110
    switches::kEnableMediaHubAudio,
110
111
    switches::kFormFactor,
111
 
    switches::kLimitMaxDecodedImageBytes,
112
 
    switches::kEnableMediaHubAudio,
113
112
    switches::kMediaHubFixedSessionDomains
114
113
  };
115
114
  command_line->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(),
195
194
  return MediaCaptureDevicesDispatcher::GetInstance();
196
195
}
197
196
 
 
197
content::PlatformNotificationService*
 
198
ContentBrowserClient::GetPlatformNotificationService() {
 
199
  return PlatformNotificationService::GetInstance();
 
200
}
 
201
 
198
202
bool ContentBrowserClient::CanCreateWindow(
199
203
    const GURL& opener_url,
200
204
    const GURL& opener_top_level_frame_url,
256
260
    prefs->shrinks_standalone_images_to_fit = false;
257
261
    prefs->default_minimum_page_scale_factor = 0.25f;
258
262
    prefs->default_maximum_page_scale_factor = 5.f;
 
263
    prefs->viewport_meta_enabled = true;
259
264
  }
260
265
 
261
266
  prefs->supports_multiple_windows = false;