Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / renderer_host / pepper / pepper_flash_browser_host.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 CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_BROWSER_HOST_H_
6 #define CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_BROWSER_HOST_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h"
11 #include "ppapi/host/host_message_context.h"
12 #include "ppapi/host/resource_host.h"
13
14 namespace base {
15 class Time;
16 }
17
18 namespace content {
19 class BrowserPpapiHost;
20 class ResourceContext;
21 }
22
23 class CookieSettings;
24 class GURL;
25
26 namespace chrome {
27
28 class PepperFlashBrowserHost : public ppapi::host::ResourceHost {
29  public:
30   PepperFlashBrowserHost(content::BrowserPpapiHost* host,
31                          PP_Instance instance,
32                          PP_Resource resource);
33   virtual ~PepperFlashBrowserHost();
34
35   // ppapi::host::ResourceHost override.
36   virtual int32_t OnResourceMessageReceived(
37       const IPC::Message& msg,
38       ppapi::host::HostMessageContext* context) OVERRIDE;
39
40  private:
41   int32_t OnUpdateActivity(ppapi::host::HostMessageContext* host_context);
42   int32_t OnGetLocalTimeZoneOffset(
43       ppapi::host::HostMessageContext* host_context,
44       const base::Time& t);
45   int32_t OnGetLocalDataRestrictions(ppapi::host::HostMessageContext* context);
46
47   void GetLocalDataRestrictions(ppapi::host::ReplyMessageContext reply_context,
48                                 const GURL& document_url,
49                                 const GURL& plugin_url,
50                                 scoped_refptr<CookieSettings> cookie_settings);
51
52   content::BrowserPpapiHost* host_;
53   int render_process_id_;
54   // For fetching the Flash LSO settings.
55   scoped_refptr<CookieSettings> cookie_settings_;
56   base::WeakPtrFactory<PepperFlashBrowserHost> weak_factory_;
57
58   DISALLOW_COPY_AND_ASSIGN(PepperFlashBrowserHost);
59 };
60
61 }  // namespace chrome
62
63 #endif  // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_BROWSER_HOST_H_