content_browser_client.h 2.22 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CEF_LIBCEF_BROWSER_CONTENT_BROWSER_CLIENT_H_
#define CEF_LIBCEF_BROWSER_CONTENT_BROWSER_CLIENT_H_
#pragma once

#include <string>
#include <utility>
#include <vector>

#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/content_browser_client.h"

class CefBrowserMainParts;
class CefMediaObserver;
19
class CefResourceDispatcherHostDelegate;
20 21

namespace content {
22
class PluginServiceFilter;
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
class SiteInstance;
}

class CefContentBrowserClient : public content::ContentBrowserClient {
 public:
  CefContentBrowserClient();
  virtual ~CefContentBrowserClient();

  CefBrowserMainParts* browser_main_parts() const {
    return browser_main_parts_;
  }

  virtual content::BrowserMainParts* CreateBrowserMainParts(
      const content::MainFunctionParams& parameters) OVERRIDE;
  virtual void RenderProcessHostCreated(
      content::RenderProcessHost* host) OVERRIDE;
  virtual void AppendExtraCommandLineSwitches(CommandLine* command_line,
                                              int child_process_id) OVERRIDE;
41 42
  virtual content::QuotaPermissionContext*
      CreateQuotaPermissionContext() OVERRIDE;
43 44
  virtual content::MediaObserver* GetMediaObserver() OVERRIDE;
  virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE;
45
  virtual void ResourceDispatcherHostCreated() OVERRIDE;
46 47
  virtual void OverrideWebkitPrefs(content::RenderViewHost* rvh,
                                   const GURL& url,
48
                                   webkit_glue::WebPreferences* prefs) OVERRIDE;
49 50
  virtual void BrowserURLHandlerCreated(
      content::BrowserURLHandler* handler) OVERRIDE;
51
  virtual std::string GetDefaultDownloadName() OVERRIDE;
52 53 54
#if defined(OS_WIN)
  const wchar_t* GetResourceDllName() OVERRIDE;
#endif
55 56 57 58 59

 private:
  CefBrowserMainParts* browser_main_parts_;

  scoped_ptr<CefMediaObserver> media_observer_;
60
  scoped_ptr<content::PluginServiceFilter> plugin_service_filter_;
61 62
  scoped_ptr<CefResourceDispatcherHostDelegate>
      resource_dispatcher_host_delegate_;
63 64 65
};

#endif  // CEF_LIBCEF_BROWSER_CONTENT_BROWSER_CLIENT_H_