summaryrefslogtreecommitdiffstats
path: root/content/browser/browser_plugin/browser_plugin_geolocation_permission_context.h
blob: 27cc9e3e4a714dd35dc553fd5aa321b784c3bee6 (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
37
38
39
40
41
42
43
44
// Copyright 2013 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 CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GEOLOCATION_PERMISSION_CONTEXT_H_
#define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GEOLOCATION_PERMISSION_CONTEXT_H_

#include "content/public/browser/geolocation_permission_context.h"

namespace content {

// Browser plugin specific implementation of GeolocationPermissionContext.
// It manages Geolocation permissions flow for BrowserPluginGuest. When a guest
// requests gelocation permission, it delegates the request to embedder though
// embedder's javascript api.
// This runs on the I/O thread. We have to return to UI thread to talk to a
// BrowserPluginGuest.
class BrowserPluginGeolocationPermissionContext :
    public GeolocationPermissionContext {
 public:
  BrowserPluginGeolocationPermissionContext();

  // GeolocationPermissionContext implementation:
  virtual void RequestGeolocationPermission(
      int render_process_id,
      int render_view_id,
      int bridge_id,
      const GURL& requesting_frame,
      base::Callback<void(bool)> callback) OVERRIDE;
  virtual void CancelGeolocationPermissionRequest(
      int render_process_id,
      int render_view_id,
      int bridge_id,
      const GURL& requesting_frame) OVERRIDE;

 private:
  virtual ~BrowserPluginGeolocationPermissionContext();

  DISALLOW_COPY_AND_ASSIGN(BrowserPluginGeolocationPermissionContext);
};

}  // namespace content

#endif  // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GEOLOCATION_PERMISSION_CONTEXT_H_