~osomon/oxide/im-fake-key-events

« back to all changes in this revision

Viewing changes to qt/core/glue/oxide_qt_web_context_adapter_p.h

  • Committer: Chris Coulson
  • Date: 2014-04-01 10:06:59 UTC
  • mfrom: (438.1.17 window-opening)
  • Revision ID: chris.coulson@canonical.com-20140401100659-48y7z8nqq6fklz0w
MergeĀ fromĀ lp:~chrisccoulson/oxide/window-opening

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include "base/files/file_path.h"
27
27
#include "base/memory/ref_counted.h"
28
28
#include "base/memory/scoped_ptr.h"
29
 
#include "base/memory/weak_ptr.h"
30
29
#include "net/base/static_cookie_policy.h"
31
30
 
32
31
#include "qt/core/glue/oxide_qt_web_context_adapter.h"
33
32
 
34
33
#include "shared/browser/oxide_browser_context.h"
 
34
#include "shared/browser/oxide_browser_context_delegate.h"
35
35
 
36
36
namespace oxide {
37
37
 
41
41
 
42
42
class BrowserContextDelegate;
43
43
struct ConstructProperties;
 
44
class RenderWidgetHostViewDelegateFactory;
44
45
 
45
 
class WebContextAdapterPrivate FINAL :
46
 
    public base::SupportsWeakPtr<WebContextAdapterPrivate> {
 
46
class WebContextAdapterPrivate FINAL : public oxide::BrowserContextDelegate {
47
47
 public:
48
48
  ~WebContextAdapterPrivate();
49
49
 
50
50
  static WebContextAdapterPrivate* get(WebContextAdapter* adapter);
51
 
 
52
 
  WebContextAdapter::IOThreadDelegate* GetIOThreadDelegate() const;
53
 
 
54
 
  oxide::BrowserContext* context() { return context_; }
 
51
  static WebContextAdapterPrivate* FromBrowserContext(
 
52
      oxide::BrowserContext* context);
 
53
 
 
54
  WebContextAdapter* adapter() const { return adapter_; }
 
55
  oxide::BrowserContext* context() const { return context_; }
55
56
 
56
57
 private:
57
 
  friend class BrowserContextDelegate;
58
58
  friend class WebContextAdapter;
59
59
 
60
60
  struct ConstructProperties {
 
61
    ConstructProperties();
 
62
 
61
63
    std::string product;
62
64
    std::string user_agent;
63
65
    base::FilePath data_path;
64
66
    base::FilePath cache_path;
65
67
    std::string accept_langs;
66
68
    net::StaticCookiePolicy::Type cookie_policy;
 
69
    bool popup_blocker_enabled;
67
70
  };
68
71
 
 
72
  static WebContextAdapterPrivate* Create(
 
73
      WebContextAdapter* adapter,
 
74
      WebContextAdapter::IOThreadDelegate* io_delegate,
 
75
      RenderWidgetHostViewDelegateFactory* view_factory);
69
76
  WebContextAdapterPrivate(WebContextAdapter* adapter,
70
 
                           WebContextAdapter::IOThreadDelegate* io_delegate);
 
77
                           WebContextAdapter::IOThreadDelegate* io_delegate,
 
78
                           RenderWidgetHostViewDelegateFactory* view_factory);
71
79
 
72
80
  void Init();
73
 
 
74
 
  WebContextAdapter* adapter;
 
81
  void Destroy();
 
82
 
 
83
  // oxide::BrowserContextDelegate
 
84
  int OnBeforeURLRequest(net::URLRequest* request,
 
85
                         const net::CompletionCallback& callback,
 
86
                         GURL* new_url) FINAL;
 
87
  int OnBeforeSendHeaders(net::URLRequest* request,
 
88
                          const net::CompletionCallback& callback,
 
89
                          net::HttpRequestHeaders* headers) FINAL;
 
90
  oxide::StoragePermission CanAccessStorage(
 
91
      const GURL& url,
 
92
      const GURL& first_party_url,
 
93
      bool write,
 
94
      oxide::StorageType type) FINAL;
 
95
  bool GetUserAgentOverride(const GURL& url,
 
96
                            std::string* user_agent) FINAL;
 
97
 
 
98
  WebContextAdapter* adapter_;
 
99
  scoped_ptr<WebContextAdapter::IOThreadDelegate> io_thread_delegate_;
 
100
  scoped_ptr<RenderWidgetHostViewDelegateFactory> view_factory_;
75
101
 
76
102
  ScopedBrowserContext context_;
77
103
  scoped_ptr<ConstructProperties> construct_props_;
78
 
  scoped_refptr<BrowserContextDelegate> context_delegate_;
79
104
 
80
105
  DISALLOW_COPY_AND_ASSIGN(WebContextAdapterPrivate);
81
106
};