Upstream version 11.39.256.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / browser / runtime_geolocation_permission_context.h
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef XWALK_RUNTIME_BROWSER_RUNTIME_GEOLOCATION_PERMISSION_CONTEXT_H_
6 #define XWALK_RUNTIME_BROWSER_RUNTIME_GEOLOCATION_PERMISSION_CONTEXT_H_
7
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10
11 class GURL;
12
13 namespace content {
14 class WebContents;
15 }
16
17 namespace xwalk {
18
19 class XWalkBrowserContext;
20
21 class RuntimeGeolocationPermissionContext
22     : public base::RefCountedThreadSafe<RuntimeGeolocationPermissionContext> {
23  public:
24   // content::GeolocationPermissionContext implementation.
25   virtual void RequestGeolocationPermission(
26     content::WebContents* web_contents,
27     const GURL& requesting_frame,
28     base::Callback<void(bool)> result_callback,
29     base::Closure* cancel_callback);
30
31  protected:
32   virtual ~RuntimeGeolocationPermissionContext();
33   friend class base::RefCountedThreadSafe<RuntimeGeolocationPermissionContext>;
34
35  private:
36   void RequestGeolocationPermissionOnUIThread(
37     content::WebContents* web_contents,
38     const GURL& requesting_frame,
39     base::Callback<void(bool)> result_callback,
40     base::Closure* cancel_callback);
41 };
42
43 }  // namespace xwalk
44
45 #endif  // XWALK_RUNTIME_BROWSER_RUNTIME_GEOLOCATION_PERMISSION_CONTEXT_H_