summaryrefslogtreecommitdiffstats
path: root/components/html_viewer/web_cookie_jar_impl.h
blob: bec897e427b73399a995060edc47e87b120f82af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2014 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 COMPONENTS_HTML_VIEWER_WEB_COOKIE_JAR_IMPL_H_
#define COMPONENTS_HTML_VIEWER_WEB_COOKIE_JAR_IMPL_H_

#include "mojo/services/network/public/interfaces/cookie_store.mojom.h"
#include "third_party/WebKit/public/platform/WebCookieJar.h"

namespace html_viewer {

class WebCookieJarImpl : public blink::WebCookieJar {
 public:
  explicit WebCookieJarImpl(mojo::CookieStorePtr store);
  virtual ~WebCookieJarImpl();

  // blink::WebCookieJar methods:
  virtual void setCookie(const blink::WebURL& url,
                         const blink::WebURL& first_party_for_cookies,
                         const blink::WebString& cookie);
  virtual blink::WebString cookies(
      const blink::WebURL& url,
      const blink::WebURL& first_party_for_cookies);
  virtual blink::WebString cookieRequestHeaderFieldValue(
      const blink::WebURL& url,
      const blink::WebURL& first_party_for_cookies);

 private:
  mojo::CookieStorePtr store_;
  DISALLOW_COPY_AND_ASSIGN(WebCookieJarImpl);
};

}  // namespace html_viewer

#endif  // COMPONENTS_HTML_VIEWER_WEB_COOKIE_JAR_IMPL_H_