~oxide-developers/oxide/oxide.trunk

« back to all changes in this revision

Viewing changes to shared/browser/oxide_browser_context.cc

  • Committer: Alexandre Abreu
  • Date: 2015-06-01 13:44:38 UTC
  • mfrom: (1103.1.1 ua)
  • Revision ID: alexandre.abreu@canonical.com-20150601134438-vuixidi2o8m2y89k
Expose user agent as part of downloadRequest

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
#include "oxide_browser_context_observer.h"
72
72
#include "oxide_browser_process_main.h"
73
73
#include "oxide_devtools_http_handler_delegate.h"
 
74
#include "oxide_download_manager_delegate.h"
74
75
#include "oxide_http_user_agent_settings.h"
75
76
#include "oxide_io_thread.h"
76
77
#include "oxide_network_delegate.h"
106
107
const char kDevtoolsDefaultServerIp[] = "127.0.0.1";
107
108
const int kBackLog = 1;
108
109
 
 
110
const char kDownloadManagerDelegateKeyName[] =
 
111
  "OxideDownloadManagerDelegateKeyName";
 
112
 
109
113
void CleanupOldCacheDir(const base::FilePath& path) {
110
114
  if (!base::DirectoryExists(path)) {
111
115
    return;
791
795
 
792
796
content::DownloadManagerDelegate*
793
797
    BrowserContext::GetDownloadManagerDelegate() {
794
 
  return nullptr;
 
798
  // The embedder owns the delegate, dont transfer ownership.
 
799
  if (!GetUserData(kDownloadManagerDelegateKeyName)) {
 
800
    SetUserData(kDownloadManagerDelegateKeyName
 
801
        , new DownloadManagerDelegate());
 
802
  }
 
803
  return static_cast<oxide::DownloadManagerDelegate*>(
 
804
      GetUserData(kDownloadManagerDelegateKeyName));
795
805
}
796
806
 
797
807
content::BrowserPluginGuestManager* BrowserContext::GetGuestManager() {