~osomon/oxide/power-save-blocker

« back to all changes in this revision

Viewing changes to shared/renderer/oxide_render_process_observer.cc

  • Committer: Chris Coulson
  • Date: 2014-06-02 15:06:30 UTC
  • Revision ID: chris.coulson@canonical.com-20140602150630-pahmaxtqonhxvmuc
Stop using WebContents::SetUserAgentOverride to set the user agent string, as this is unreliable in some circumstances. Instead, have a child-process-global user agent string

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "ipc/ipc_message_macros.h"
22
22
#include "net/base/net_module.h"
23
23
 
 
24
#include "shared/common/oxide_content_client.h"
24
25
#include "shared/common/oxide_messages.h"
25
26
#include "shared/common/oxide_net_resource_provider.h"
26
27
 
34
35
  g_is_off_the_record = incognito;
35
36
}
36
37
 
 
38
void RenderProcessObserver::OnSetUserAgent(const std::string& user_agent) {
 
39
  ContentClient::instance()->SetUserAgent(user_agent);
 
40
}
 
41
 
37
42
bool RenderProcessObserver::OnControlMessageReceived(
38
43
    const IPC::Message& message) {
39
44
  bool handled = true;
40
45
  IPC_BEGIN_MESSAGE_MAP(RenderProcessObserver, message)
41
46
    IPC_MESSAGE_HANDLER(OxideMsg_SetIsIncognitoProcess, OnSetIsIncognitoProcess)
 
47
    IPC_MESSAGE_HANDLER(OxideMsg_SetUserAgent, OnSetUserAgent)
42
48
    IPC_MESSAGE_UNHANDLED(handled = false)
43
49
  IPC_END_MESSAGE_MAP()
44
50